unrecognized selector error when calling -stringValue on NSNumber
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