What's the difference between -existingObjectWithID:error:
and –objectWithID:
?
objectWithID:
assumes the object exists so if you give it a bad ID it will throw an exception when you attempt to access a property on the returned entity. Also, this method always returns an entity.
existingObjectWithID:error:
will return an object if it exists and nil
if it does not. If there was an error it will populate the error pointer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With