Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode 7 Type arguments cannot be applied to non-parameterized class

I'm getting this error in my xcode project today... I have never got it before. The only change I've made since the last successful build is that I imported the iAD framework (I did that this morning before I tried to do a fresh build, so I'm not sure if it had anything to do with it. I doubt it though.) All of the issues are with NSSet/NSArray/NSDictionary and are all contained in UIKit's UIEvent and CoreImage's CIImage. If anyone has any idea what might be going on here, I would appreciate the input.

Edit: I forgot to mention the specific errors. Here they are:

"Type arguments cannot be applied to non-parameterized class 'NSSet'",

"Type arguments canot be applied to non-parameterized class 'NSArray'",

"Type arguments canot be applied to non-parameterized class 'NSDictionary'"

Edit 2: I did not realize that the app store automatically updated xcode from 6.4 to 7.0, so I changed to title to reflect the correct xcode version.

Here's where it's happening in UIEvent.h (lines 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.

Here's where it's happening in UIResponder.h (lines 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;

Also happening in UIREsponder.h (line 79):

@interface UIResponder (UIResponderKeyCommands)
@property (nullable,nonatomic,readonly) NSArray<UIKeyCommand *>     *keyCommands NS_AVAILABLE_IOS(7_0); // returns an array of UIKeyCommand objects<
@end

Here's where it's happening in CIImage.h lines 97 and 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);
like image 507
Trevor Panhorst Avatar asked Sep 24 '15 20:09

Trevor Panhorst


1 Answers

I had also this error, and I just changed @class to #import for problematic class and then clean and build and it was ok again... some bug I think... The class with problem was my own parametrised class.

like image 119
Renetik Avatar answered Nov 17 '22 01:11

Renetik