xcode 7类型参数不能应用于非参数化类 [英] xcode 7 Type arguments cannot be applied to non-parameterized class

查看:45
本文介绍了xcode 7类型参数不能应用于非参数化类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天在我的xcode项目中遇到了这个错误……我以前从未遇到过.自上次成功构建以来,我所做的唯一更改是导入了iAD框架(今天早晨我在尝试进行新构建之前就做了此操作,因此我不确定它是否与它有任何关系.我所有问题都与NSSet/NSArray/NSDictionary有关,并且都包含在UIKit的UIEvent和CoreImage的CIImage中.如果有人知道这里可能会发生什么,我将不胜感激.

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.

我忘记提及具体错误了.他们在这里:

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

类型参数不能应用于非参数化类'NSSet'",

无法将类型参数应用于非参数化类'NSArray'",

无法将类型参数应用于非参数化的类'NSDictionary'"

我没有意识到应用商店会自动将xcode从6.4更新为7.0,因此我更改为标题以反映正确的xcode版本.

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.

这是UIEvent.h中发生的情况(第50、51、52、53、56、59行):

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.

这是UIResponder.h中发生的情况(第31-34行):

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;

也在UIREsponder.h中发生(第79行):

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

在这里,它发生在CIImage.h第97和102行:

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);

推荐答案

我已经重新考虑了这个问题,看来其他人已经在不同的线程中解决了该问题.在github上.

I have revisited this issue and it appears others have addressed it in different threads & on github.

问题是我包含在项目中的Parse/Bolts框架已过时,并且已将它们保存在本地项目中.我在项目中使用的版本与xcode 7冲突.

The problem was that the Parse/Bolts framework that I had included in my project was out of date and that I had them saved locally in my project. The version that I had in my project conflicted with xcode 7.

在删除所有本地副本并将"pod'Parse'"添加到我的pod文件并运行"pod install"之后,此特定问题已解决.

After removing all local copies and adding "pod 'Parse'" to my pod file and running 'pod install', this specific issue was resolved.

对于有相关问题的任何人,您都应尝试更新项目中保留的旧依赖性,并查看哪些问题可以为您解决此问题.

For anyone having a related issue, you should try updating the old dependancies that you have remaining in your project and see which fixes this issue for you.

以下是一些相关主题,它们更详细地讨论了此问题:

无法应用类型参数PFAnalytics和PFObject中的非参数化类BFTask

https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/297

这篇关于xcode 7类型参数不能应用于非参数化类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆