In Java, long always 64 bits. In C and Objective-C, a long may be 64 bits or it may be 32 bits or (in less common cases) it may be something completely different; standard C does not define the exact bit width.
In OS X a NSInteger is 64 bits on 64-bit platforms and 32 bits on 32-bit platforms. Mac 32-bit platforms are becoming less common, so you can use NSInteger and be fine.
However, if you always want to use a 64-bit integer, you probably want to use the int64_t data type defined in stdint.h .
source share