NSInteger problem
How to use the NSInteger give ex开发者_JAVA技巧ample and simplecode
NSInteger
is defined like this:
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
It's the same as int
on 32Bit or long
on 64Bit.
NSInteger a, b, c;
a = 2;
b = 40;
c = a + b;
NSLog(@"THE answer is: %d\n", c);
精彩评论