我今天在我的 xcode 项目中遇到这个错误...我以前从未遇到过。自上次成功构建以来我所做的唯一更改是导入了 iAD 框架(今天早上我在尝试进行新构建之前执行了此操作,所以我不确定它是否与此有关。我不过我对此表示怀疑。)所有问题都与 NSSet/NSArray/NSDictionary 相关,并且都包含在 UIKit 的 UIEvent 和 CoreImage 的 CIImage 中。如果有人知道这里可能发生什么,我将不胜感激。
编辑:我忘了提及具体错误。他们来了:
“类型参数不能应用于非参数化类‘NSSet’”,
“类型参数不能应用于非参数化类‘NSArray’”,
“类型参数不能应用于非参数化类‘NSDictionary’”
编辑2:我没有意识到应用程序商店自动将xcode从6.4更新到7.0,所以我更改为标题以反映正确的xcode版本。
这是 UIEvent.h 中发生的位置(第 50、51、52、53、56、59 行):
- (nullable NSSet <UITouch *> *)allTouches;
- (nullable NSSet <UITouch *> *)touchesForWindow:(UIWindow *)window;
- (nullable NSSet <UITouch *> *)touchesForView:(UIView *)view;
- (nullable NSSet <UITouch *> *)touchesForGestureRecognizer: (UIGestureRecognizer *)gesture NS_AVAILABLE_IOS(3_2);
// An array of auxiliary UITouch’s for the touch events that did not get delivered for a given main touch. This also includes an auxiliary version of the main touch itself.
- (nullable NSArray <UITouch *> *)coalescedTouchesForTouch:(UITouch *)touch NS_AVAILABLE_IOS(9_0);
// An array of auxiliary UITouch’s for touch events that are predicted to occur for a given main touch. These predictions may not exactly match the real behavior of the touch as it moves, so they should be interpreted as an estimate.
这是 UIResponder.h 中发生的情况(第 31-34 行):
// Generally, all responders which do custom touch handling should override all four of these methods.
// Your responder will receive either touchesEnded:withEvent: or touchesCancelled:withEvent: for each
// touch it is handling (those touches it received in touchesBegan:withEvent:).
// *** You must handle cancelled touches to ensure correct behavior in your application. Failure to
// do so is very likely to lead to incorrect behavior or crashes.
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
- (void)touchesCancelled:(nullable NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
也发生在 UIREsponder.h(第 79 行)中:
@interface UIResponder (UIResponderKeyCommands)
@property (nullable,nonatomic,readonly) NSArray<UIKeyCommand *> *keyCommands NS_AVAILABLE_IOS(7_0); // returns an array of UIKeyCommand objects<
@end
这是 CIImage.h 第 97 行和第 102 行中发生的情况:
/* Creates a new image from the contents of 'image'. */
+ (CIImage *)imageWithCGImage:(CGImageRef)image;
+ (CIImage *)imageWithCGImage:(CGImageRef)image
options:(nullable CI_DICTIONARY(NSString*,id) *)options;
/* Creates a new image from the contents of 'layer'. */
+ (CIImage *)imageWithCGLayer:(CGLayerRef)layer NS_DEPRECATED_MAC(10_4,10_11);
+ (CIImage *)imageWithCGLayer:(CGLayerRef)layer
options:(nullable CI_DICTIONARY(NSString*,id) *)options NS_DEPRECATED_MAC(10_4,10_11);