> Is there a way (in a Core Data entity) to make an attribute that's > like a relational DB "autoincrement" field? Or, failing that, does an > object of class (or subclass) NSManagedObject inherit a "unique" > UInt32 value that can reliably differentiate it from any other > instance being managed by the NSManagedObjectContext in use?
Each managed object has an objectID that is unique and automatically assigned. NSManagedObjectID are opaque value classes, but you can serialize the -URIRepresentation of an objectID. Mutating the URI form and then reimporting it is unsupported with extreme prejudice. If you must have an int32 autoincremented, you'll need to create your own. You can create an entity with a single row to store the integer and update it transactionally. - Ben _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com