check if NSNumber is empty

后端 未结 5 1063
醉话见心
醉话见心 2021-02-07 05:28

How do I check if a NSNumber object is nil or empty?

OK nil is easy:

NSNumber *myNumber;
if (myNumber == nil)
    doSomething

But if th

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 05:51

    NSNumbers are immutable and can only be created with either a factory method or initial method that gives them some numeric value. As far as I know it is not possible to end up with an 'empty' NSNumber, unless you count 0.

提交回复
热议问题