In Core Data, I have many attributes declared as Integer 64, and then accessed through NSNumber properties (this is by default).
Does it matter if I store and access these values by:
NSNumber *mySetValue = [NSNumber numberWithInt:someIntValue];
[myObject setMyNumberProperty:mySetValue];
int myRetrievedValue = [myObject.myNumberProperty intValue];
or by
NSNumber *mySetValue = [NSNumber numberWithInteger:someIntegerValue];
[myObject setMyNumberProperty:mySetValue];
NSInteger myRetrievedValue = [myObject.myNumberProperty integerValue];
?
There are two case for which I would like to know the answer: 1) if the value needed is used for calculations (it holds a quantity or a value that will be converted to currency) and 2)if the value is just a type which will basically only be compared against itself and will not be used for any calculations. Is it okay to use numberWithInt and intValue in one case and not the other, both cases, or must numberWithInteger and integerValue be used in both cases?
Also, does it matter if I have previously stored all of the values as [NSNumber numberWithInt:] - can I simply change the way I store/retrieve the value now, or do I need to maintain consistency so as not to create a problem with current user data?
I am particularly interested in this working in both a 32 bit and 64 bit iOS app.
Also - does it make a difference to your answer if the Core Data value is Integer 32, Integer 16, Integer 64, etc?