Xcode 4 gives me (rather useless) errors regarding the "unimplemented selector" xxx "when I try to use @selector (xxx) with any method not actually defined in the same source file. The error goes away (at least to build the project ), if I set the LLVM compiler warning βMultiple definition types for the selectorβ to βNo.β (This is the default value for iOS, but it was turned on for my project.) However, even with this, turning off the error appears in the editor if in the dialog the "Build options" window has the option "Enable live problems "strike">
So, now I turned off the live releases so as not to be distracted, which is a little let down. My question is: is there a way to get rid of the error, possibly by specifying which selector definition I want to use? Or is it even important, i.e. Do all method definitions have the same selector in Objective-C? Is this a compiler error, or perhaps a dummy setting, which I should just leave? (And if the latter, why is it enabled for the live build function in the new editor?)
Here is the code to be clear:
if ([recognizer respondsToSelector:@selector(translationInView:)]) { ... }
And here is the error:
error: unimplemented selector 'translationInView:' [-Wselector,2] if ([recognizer respondsToSelector:@selector(translationInView:)]) { ^
If I replaced 'translationInView:' with a method defined in the same source file, there is no error. I imported the header that defines this method, and I tried to declare the method in a category in this source file. Never mind.
I leave the warning off and the living builds and advances, but I would like to find the best solution for this problem. At the very least, I would like to know if Objective-C @selector has syntax for choosing a specific method definition, since I have not yet found any signs of this.
Thanks!
big_m source share