Friday, 9 August 2013

What can I do to avoid the app crashing when it encounters a null value?

What can I do to avoid the app crashing when it encounters a null value?

What can I do to avoid the app crashing when it encounters a null value?
the error message I get is:
-[NSNull mutableCopyWithZone:]: unrecognized selector sent to instance
I tried this conditional statement to check for a null value, but it still
crashes:
if ([listingWebAddress mutableCopy] != (NSString *)[NSNull null])
{
[webLabel setText:@""];
} else {
[webLabel setText:[listingWebAddress mutableCopy]];
}
thanks for the help :)

No comments:

Post a Comment