Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

duggram

macrumors 6502
Original poster
Apr 17, 2008
391
11
Using SL 10.6, Xcode 3.2

With the RaiseMan app from chap 8, after implementing sorting (p134) I'm getting this error when I try to sort:

[NSCFString caseInsensitiveCompare]: unrecognized selector sent to instance

When I remove the caseInsensitiveCompare selector for the first column in IB the sorting works fine in the first column. To me this indicates that there is something wrong with the personName variable. Checked my @synthesized and @property code. Checked all of my code. Checked all IB settings. Looks exactly the same as in the book.

Checked the book's forum for others with the same problem. No one. Checked the errata. Searched Google a bunch of different ways. Search this forum. Noticed that all problems with this particular chapter deal with the challenges.

I've done something wrong. But my code looks like the book. I've triple checked all my settings in IB. I'd like to have the app work as designed before moving on. Any suggestions?
 
I really am not familiar with interface builder, and how all of that works out... but it looks like caseInsensitiveCompare is being sent to an NSString instead of caseInsensitiveCompare: (NSString *)someString. I'm guessing that's what the problem is, but i certainly don't know how you can send a message with no parameters to an NSString and get any sort of comparison result.

-Lee
 
Just ran over this problem, the reason is: don't forget to put a colon terminating the selector's name "caseInsensitiveCompare:".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.