Skip navigation.
 
mlRe: Using an auto incremented NSNumber as attribute in a NSManagedObject
FROM : Joshua Preston
DATE : Thu Mar 06 23:32:59 2008

Chris,

The short answer is for quick look ups.  My application creates a new 
managed object which represents a new "issue".  When the person done 
with the entry completes it, they should be issued a "tracking 
number".  For reasons ubiquitous with telephone support, I am 
attempting to only utilize numeric values.  So for example, I create a 
new ticket, I should be able to look it up by a human readable index 
using very low tech means--think telephone keypad...

Now I won't claim to be the expert on this subject, but it did seem to 
me that the indexes (keys) created by core data would probably not use 
a simple integer for key look ups, or allow me to specify a range of 
valid numbers.  I mean, for ease of use, I was going to start my range 
in the millions to keep a consistent length of the "reference id".

Regards,

Joshua Preston
Joshua.<email_removed>




On Mar 6, 2008, at 4:56 PM, Chris Hanson wrote:

> On Mar 6, 2008, at 1:05 PM, Joshua Preston wrote:
>

>> I am however having problems finding information regarding auto 
>> incremented attributes, namely an NSNumber attribute.

>
> What do you want to do with this?  Core Data manages primary & 
> foreign keys for you via object IDs and relationships, so you don't 
> have to do anything with those yourself.  (And those are the typical 
> uses of auto-incrementing fields or sequences.)
>
> -- Chris
>