title: Core Data, NSNumber, Integer 32 and Integer 64
body: <p>In Core Data, I have many attributes declared as Integer 64, and then accessed through NSNumber properties (this is by default).</p>
  
  <p>Does it matter if I store and access these values by:</p>
  
  <pre><code>NSNumber *mySetValue = [NSNumber numberWithInt:someIntValue];
  [myObject setMyNumberProperty:mySetValue];
  
  int myRetrievedValue = [myObject.myNumberProperty intValue];
  </code></pre>
  
  <p>or by</p>
  
  <pre><code>NSNumber *mySetValue = [NSNumber numberWithInteger:someIntegerValue];
  [myObject setMyNumberProperty:mySetValue];
  
  NSInteger myRetrievedValue = [myObject.myNumberProperty integerValue];
  </code></pre>
  
  <p>?</p>
  
  <p>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?</p>
  
  <p>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?</p>
  
  <p>I am particularly interested in this working in both a 32 bit and 64 bit iOS app.</p>
  
  <p>Also - does it make a difference to your answer if the Core Data value is Integer 32, Integer 16, Integer 64, etc?</p>