Possible Duplicate:
How to convert An NSInteger to an int?
I am new to iOS programming, how do I convert int to NSInteger. I have found references on how to convert NSInteger to NSNumber but I wasn’t able to figure it out. Any help would be appreciated. Thanks.
An improved answer
On 64-bit systems
NSIntegerislong. On 32-bit systemsNSIntegerisint.https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Cocoa64BitGuide/64BitChangesCocoa/64BitChangesCocoa.html
All you need just cast your
inttoNSInteger.You can also cast
NSIntegertoint(as in an original answer), but you must be careful on 64-bit system, because yourNSIntegercan exceedintlimits.An original answer
No big science. 🙂