I,ve found IsInserted property, but what if I created object without inserting it into managed context? Maybe I can use ObjectID somehow for such a purpose?
views:
17answers:
1
Q:
What is the simplest way to know that NSManagedObject instance is new and hasn't been persisted yet?
+1
A:
Is inserted should work fine, because you cannot create a managed object without inserting it. You could also use the isTemporaryID method on the objectID, which returns YES if the object was not yet inserted.
Keep in mind that inserted does not mean persisted. If you insert an object into a managed object context you must first save the context before the object will be persisted (and then in turn the object does not count as being inserted anymore).
frenetisch applaudierend
2010-09-21 19:43:58