Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which integer types to use for Core Data integers

Core Data has int16, int32, and int64. When working with these in their NSNumber form should I use NSInteger or int ( and their respective NSNumber methods numberWithInt, numberWithInteger ). I have been using int for int16 and NSInteger for int32, but I don't know if this is correct. I would just like some clarification.

like image 494
Brian Avatar asked Oct 24 '22 09:10

Brian


1 Answers

NSInteger is at least 32 bit, as is int. I wouldn't ever use int16, unless you need to represent a short.

NSInteger can also be 64 bit, in a 64bit runtime...

like image 153
Grady Player Avatar answered Nov 15 '22 09:11

Grady Player