Hillegass TableView caseInsensitiveCompare selector error

Discussion in 'Mac Programming' started by duggram, Aug 31, 2009.

  1. duggram macrumors 6502

    duggram

    Joined:
    Apr 17, 2008
    #1
    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?
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    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
     
  3. Archie3D macrumors newbie

    Joined:
    Nov 14, 2009
    #3
    Just ran over this problem, the reason is: don't forget to put a colon terminating the selector's name "caseInsensitiveCompare:".
     

Share This Page