• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ????
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >[Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ???? (From: Aurélien Hugelé <email@hidden>)
 >Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ???? (From: Aurélien Hugelé <email@hidden>)

  • Prev by Date: Re: Sensible way to extend base class?
  • Next by Date: Re: Bindings and KVO of View objects
  • Previous by thread: Re: [Core Data] Difference between objectWithID: and a fetch "self IN %@", someObjectIDs ????
  • Next by thread: Memory management in QuickLook plugin
  • Index(es):
    • Date
    • Thread