1.NSNumber is a class that inherits from Nsvalue that is a collection of basic data types including char a signed or unsigned char, short int, int, long int, long long int, Floa T, or double or as a BOOL
The NSNumber type is a bit like the ID type, which can be declared for any type of numeric object, that is, it is used to declare a numeric object, it is very difficult to determine what type of number the declaring variable is, and to determine that the Number object type is determined at initialization time.
2.int:32 bit integral type
int is an integer type, signed
unsigned int is an unsigned integer type
When you use the int type to define a variable, you can use int or Nsinteger as a C program, and we recommend using Nsinteger because this does not have to consider whether the device is 32-bit or 64-bit (varies with compiler changes for different platform 32, The 64-bit has a different maximum value (int long).
3.
Nsuinteger are unsigned, that is, there are no negative numbers, and Nsinteger are signed.
Nsinteger is the underlying type, NSNumber is a class, if you need to store a numeric value, the direct use of nsinteger is not possible, such as in an array using the following statement will be error:*array = [Nsarray alloc ] init]; [Array AddObject: 3 ]; because the array should be a class, but ' 3 ' No, so need to use NSNumber:*array = [Nsarray alloc] init] ; [Array addobject:[nsnumber numberwithint:3]];
IOS int Nsinteger NSNumber differentiate