I have this piece of code:
- (id) getSearchSuggestions:(NSString*)q;
- (NSOperationQueue*) getSearchSuggestions:(NSString*)q callback:(id<UserDelegate>)callback;
- (id) getSearchSuggestions;
- (NSOperationQueue*) getSearchSuggestions:(id<UserDelegate>)callback;
And I Xcode keeps showing me an error on the last line:
Duplicate declaration of method "getSearchSuggestions"
Why? It seems to me that the signatures are all different.
This signature:
Is identical to this signature:
All object pointers are
id. So both of these are methods that take an object and return an object.Examples of better names would be:
It’s not exactly clear why you return an operation queue here, but this is the kind of name you’d use for a method that did that.