state of documents:
... This method always returns an object. Data in persistent storage represented by objectID is supposed to exist - if it is not, the returned object throws an exception when you access any property (that is, when an error is triggered). The advantage of this behavior is that it allows you to create and use errors, and then create the baseline later or in a separate context.
and in the Apple Core Recipes sample application, the result of the method is used to populate NSFetchRequest, and then the result of the request with comments on this effect is used:
I saw many examples (other code and apple 'iClass'), where the result from objectWithID used directly - this means that its properties are available and processed together.
Should objectWithID always be considered as a possibly-this-existing object?
I ask because I just ran into this and was not going to exist.
cocoa core-data nsmanagedobjectcontext
lulu Jan 27 '11 at 15:49 2011-01-27 15:49
source share