开发者

XCODE protocol qualifiers without id is archaic

i'm a begginer xcode developer and usign the xcode 4 trying follow a xcode 3.2 tutorial the IDE show me the error;

protocol qualifiers without id is archaic

how i can solve it, what is the correct declaration

tutorial; http://www.youtube.com/watch?v=2Rd9TtG3Uws

code;

<UIPickerViewDataSource, UIPicke开发者_StackOverflow中文版rViewDelegate> {

    NSArray* activities;
    NSArray* fellings;
}


When you declare the interface, it inherits from a base class such as NSObject, UIView, UIViewController etc... You need the interface name, then the base class then the delegates it supports.

Something like this:

@interface MyView: UIView <UIPickerViewDataSource, UIPickerViewDelegate> {
    NSArray* activities;
    NSArray* fellings;
}

Also, if you're implementing an object that expects something that implements that protocol you should accept id in the signature. Fr example:

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

See this SO question with the same error:

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


You need to have

@interface Classname : InheritedClassname 

before the <

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜