re:NSManagedObject awakeFromFetch not sent on secondary thread?
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