What does this LLVM 1.5 warning mean? “protocol qualifiers without 'id' is archaic”

六眼飞鱼酱① 提交于 2019-12-02 11:56:23

问题


I've just tried compiling an iOS project using the the LLVM 1.5 compiler (included in XCode 3.2.3), and I got a lot of new warnings, including several like this:

protocol qualifiers without 'id' is archaic

For instance, this happens on lines like this:

- (id)initWithContext:(NSManagedObjectContext *)context
          coordinator:(NSPersistentStoreCoordinator *)coordinator
             delegate:(<NSFetchedResultsControllerDelegate>)delegate;

Now, I think this is probably a "naming conventions" warning, but anyone know what it really means?


回答1:


Archaic: extremely old or extremely old-fashioned.

The warning means a protocol qualifier (i.e. <NSFetchedResultsControllerDelegate>) without an id is deprecated. The delegate parameter's type should look like:

- (id)initWithContext:(NSManagedObjectContext *)context
          coordinator:(NSPersistentStoreCoordinator *)coordinator
             delegate:(id<NSFetchedResultsControllerDelegate>)delegate;
       //              ^^


来源:https://stackoverflow.com/questions/3094124/what-does-this-llvm-1-5-warning-mean-protocol-qualifiers-without-id-is-archa

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!