• 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:NSManagedObject awakeFromFetch not sent on secondary thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re:NSManagedObject awakeFromFetch not sent on secondary thread?


  • Subject: re:NSManagedObject awakeFromFetch not sent on secondary thread?
  • From: Ben Trumbull <email@hidden>
  • Date: Mon, 15 Mar 2010 12:36:12 -0700

> My custom NSManagedObject subclass uses awakeFromInsert and awakeFromFetch
> to setup custom object to ivar. This works as expected, but when I fetch the
> same object on secondary thread (in NSOperation), the ivar remains nil as
> awakeFromFetch is not sent...
>
> Is NSManagedObject's awakeFromFetch supposed to be sent when fetching on
> secondary thread?

Does the secondary thread have its own private NSManagedObjectContext that you are using for the fetch, or are you fetching against an NSManagedObjectContext that was created on another thread ?  If you are using an NSOperationQueue with maxConcurrency > 1, then each NSOperation will need to allocate, use, and deallocate its own NSManagedObjectContext.

- Ben

_______________________________________________

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

  • Follow-Ups:
    • Re: NSManagedObject awakeFromFetch not sent on secondary thread?
      • From: Tom <email@hidden>
  • Prev by Date: Re: Checking integrity of a Core Data document with SQLite store
  • Next by Date: Re: Problem with "save as" and freed managed object context
  • Previous by thread: NSManagedObject awakeFromFetch not sent on secondary thread?
  • Next by thread: Re: NSManagedObject awakeFromFetch not sent on secondary thread?
  • Index(es):
    • Date
    • Thread