How to check for null value in NSNumber

后端 未结 3 682
孤街浪徒
孤街浪徒 2021-01-06 02:14

First off I confess my ignorance, I\'ve learned everything I know about Objective-C in the few months I\'ve been working on my project. I also find it utterly frustrating ho

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 02:54

    In Objective-c, it's nil not null. So:

    if (shotIndex != nil) {
       // its not nil
    }
    

提交回复
热议问题