int vs NSNumber vs NSInteger

后端 未结 4 1363
迷失自我
迷失自我 2021-02-02 10:09

I have a line of code that will work differently depending on the datatypes \"day\" and \"1\". I believe it is the following although I will check my source code later.

4条回答
  •  伪装坚强ぢ
    2021-02-02 10:37

    NSInteger and int are equivalent, NSNumber is an object used to store primitive number types (int, long, float, etc.).

    The example code you posted will work just fine if day is an NSinteger, it won't work at all if it's an NSNumber.

提交回复
热议问题