• 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: Managed Object won't dealloc even after Hit with Kitchen Sink
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Managed Object won't dealloc even after Hit with Kitchen Sink (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: NSCalendar/NSDate - generating all months/days in a year
  • Next by Date: Re: warning: unused parameter '_value'
  • Previous by thread: Re: Managed Object won't dealloc even after Hit with Kitchen Sink
  • Next by thread: re: Managed Object won't dealloc even after Hit with Kitchen Sink
  • Index(es):
    • Date
    • Thread