Is there a way to check if the value is NULL / Nil before assigning a BOOL?
For example, I have a value in NSDictionary, which may have the value TRUE / FALSE / NULL
mySTUser.current_user_following = [[results objectForKey:@"current_user_following"]boolValue];
When the value is NULL, I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSNull boolValue]: unrecognized selector sent to instance
I would like to be able to handle the NULL case.
source share