I'm getting this crash, but, in my code I am using a string. I've been working on this one piece of code for 2 hours now and I just can't see what I'm missing! Any ideas?
NSString *codeR = [NSString stringWithFormat:@"%@", [[object objectForKey:@"code"] stringValue]];
if([codeR isEqualToString:@"200"])
Error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x181cf0'
I would be very grateful input, this is confusing the hell out of me!
Thanks.
Get rid of silly redundancy, see what happens.
NSString *codeR = [[object objectForKey:@"code"] stringValue];
// mysterious missing code
if ([coreR isEqualToString:@"200"]) // etc
Also, are you sure the error is raised from the if
statement you posted? It could be coming from elsewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With