Detect if NSNumber is equal to NULL
How do I detect if a NSNumber is NULL? For example, I use a开发者_运维百科 NSLog to display the value of a NSNumber and if there is an incorrect value, such as letters, it shows "null" in the log. Thanks for your help!
Can't you just do
NSNumber *testNumber;
if(testNumber == nil){
NSLog(@"the testNumber is nil");
}
精彩评论