Warning: not implemented localizedCaseInsensitiveCompare selector

I get a warning on the following line:

NSSortDescriptor * sort = [ [NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:) ]; 

And I did not always get this warning. That is, a warning has only just begun to appear recently, possibly due to a change in compilation settings. I do not see typos here. This looks (to me) exactly the same as the code I saw in many examples. I do not see runtime exceptions. But I don't like the warnings. Has anyone seen this? Any idea what launches it?

+8
objective-c cocoa
source share
1 answer

Have you turned on -Wselector ? (Also called β€œMultiple Definition Types for a Selector.”) This warning is not compatible with Foundation, and you should not include it. It exists because it makes sense in a β€œpure” Objective-C. Just not in any Objective-C that you could ever write (i.e. Everything Cocoa uses).

Warning message -Wundeclared-selector , also called "Undeclared Selector".

It is somewhat outdated, but I made a complete list of GCC warnings and enable or disable them in the Shared.xcconfig file. There is also a very useful bestiary, compiled by Jean-David Gadina , which is a bit more modern.

+14
source share

All Articles