开发者

Detect if NSNumber is equal to NULL

开发者 https://www.devze.com 2023-03-29 11:43 出处:网络
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. T

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

精彩评论

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