NSManagedObjectID into NSData

Posted by papr on Stack Overflow See other posts from Stack Overflow or by papr
Published on 2009-02-05T15:44:51Z Indexed on 2010/05/02 19:47 UTC
Read the original article Hit count: 154

Filed under:
|
|
|

I found this wonderful NSManagedObjectID. This would be very good for referencing an Entity/NSManagedObject/NSEntityDescription, right?
Let's get an ID from an entity:

NSEntityDescription *entity = [self newEntity];     
NSManagedObjectID *objID = [entity objectID];

So... any idea how to get this objID into a string? Or better: NSData. Actually something to be able to save it to the NSUserDefaults. ;-)

Btw: NSFetchRequest doesn't want to work in my case. I use an modified version of this example: answer of an old question.

© Stack Overflow or respective owner

Related posts about core-data

Related posts about cocoa