• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
unrecognized selector error when calling -stringValue on NSNumber
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unrecognized selector error when calling -stringValue on NSNumber


  • Subject: unrecognized selector error when calling -stringValue on NSNumber
  • From: "Mazen M. Abdel-Rahman" <email@hidden>
  • Date: Sun, 06 Dec 2009 16:58:17 -0700

Hi all,

I am getting a very confusing error when I try to send a -stringValue message to an NSNumber object.  Here is my code:

NSNumber * primaryLanguageNumber = [self primaryLanguageID];
NSString * primaryLanguageString = [primaryLanguageNumber stringValue];

primaryLanguageID is of type NSNumber.  When I am stepping through the debugger I can see the variable primaryLanguageNumber being set correctly.  However, once I try to call stringValue on it I get the following error:

2009-12-06 16:51:24.525 Averroes[21013:a0f] -[NSCFString stringValue]: unrecognized selector sent to instance 0x1001d8a70

Doesn't that mean that it thinks primaryLanguageNumber is a string?  And why would it see it as a string?

Thanks for your help!
Mazen Abdel-Rahman
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: unrecognized selector error when calling -stringValue on NSNumber
      • From: Quincey Morris <email@hidden>
    • Re: unrecognized selector error when calling -stringValue on NSNumber
      • From: Joar Wingfors <email@hidden>
    • Re: unrecognized selector error when calling -stringValue on NSNumber
      • From: Dave Carrigan <email@hidden>
  • Prev by Date: Re: Best way to hook into the run loop?
  • Next by Date: Re: NSTextView & Horizontal Scrollbar bug
  • Previous by thread: Re: Heap and memory zone queries
  • Next by thread: Re: unrecognized selector error when calling -stringValue on NSNumber
  • Index(es):
    • Date
    • Thread