Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ????
Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ????
- Subject: Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ????
- From: Kyle Sluder <email@hidden>
- Date: Wed, 20 May 2009 11:56:46 -0400
On Wed, May 20, 2009 at 8:25 AM, Aurélien Hugelé
<email@hidden> wrote:
> There clearly is a difference since fetching is *much* slower that
> objectWithID: then testing using try/catch is the object is a fault or not.
Read the -[NSManagedObjectContext obtainPermanentIDsForObjects:error:]
docs carefully:
"This method results in a transaction with the underlying store which
changes the file’s modification date."
Think about that for a second. You're essentially saving the store to
disk for each time you call -obtainPermanentIDsForObjects:error: (it's
not really a "save" in the Core Data sense, but it is writing the
store out to disk every time). Either batch all your requests up in
one call to -obtainPermanentIdsForObjects:error:, or don't call it.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden