开发者

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");

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜