Hi
I have a Core Data Entity that needs to hold onto the NSManagedObjectID
of some other Entity. To do so I was considering converting the ObjectID to a string that is an approved type of an NSManagedObject
attribute.
I can read from the documentation that I can get a URI representation of the ID by:
NSURL *uriID = [[myEntity objectID] URIRepresentation];
I can then convert this URL to an NSString by:
NSString *stringID = [uriID absoluteString];
This I can persist to my NSManagedObject
's NSString attribute.
Now what happens when I need to go the other way?
I would like to be able to do something like this:
if([myManagedObject objectID] == value)
where value is the NSManagedObjectID
that I converted to an NSString earlier.
To shed a little more light on the why: I need to be able to have an Entity object hold and persist the ObjectID of another Entity object, so that I later on can go: this Objects last "interaction" was with this Entity.
Hope someone can help me get this working:) Thank you