Re: Managed Object won't dealloc even after Hit with Kitchen Sink
Re: Managed Object won't dealloc even after Hit with Kitchen Sink
- Subject: Re: Managed Object won't dealloc even after Hit with Kitchen Sink
- From: Jim Correia <email@hidden>
- Date: Mon, 22 Dec 2008 12:25:16 -0500
On Dec 22, 2008, at 12:17 AM, Jerry Krinock wrote:
REAL-LIFE PROBLEM
In a managed memory application, I have a managed object which,
besides its Core Data managed properties, has a single instance
variable, a worker-kind of object which does some heavy lifting for
it. So that this retained worker, etc., will be deallocced, I need
this managed object to get deallocced when no longer needed.
The documentation [1] seems very clear that, although the
'insert...' methods return an autoreleased NSManagedObject, a
managed object may be retained by:
(a) the managed object context, until changes are saved
or rolled back, or,
(b) the managed object context's undo manager, as long as
an action involving the managed object remains on
the undo stack.
The documentation is also clear that Core Data "reserves exclusive
control over the life cycle of the managed object".
Absent a really good reason not to, you probably should release (and
nullify the iVar) the worker-kind object when you are turned into a
fault (-didTurnIntoFault.)
If you do this, does it solve your problem?
Jim
_______________________________________________
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