• 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, retain count and dealloc:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSManagedObject, retain count and dealloc:


  • Subject: Re: NSManagedObject, retain count and dealloc:
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 26 Apr 2010 15:18:35 -0700

On Mon, Apr 26, 2010 at 2:14 PM, vincent habchi <email@hidden> wrote:
> I am unable to see a NSManagedObject go through the dealloc: method, even after its removal from the MOC. It seems these objects are created after a initWithEntity:insertIntoMOC: with an initial retain count of 2, and, of course, it is impossible to make the retain count (by honest means) drop below 2. Is this normal expected behavior?

As far as you're concerned, it's perfectly valid behavior for every
object in your application to never see -dealloc called, ever. As long
as you are playing by the memory management rules, you shouldn't care
one whit about when -dealloc is called. Those who work with -finalize
in a GC environment are already familiar with this drill.

If your object is holding on to some resource which you need it to
release, write a method called -invalidate or -letGoOfImportantThing
or something and call that at a deterministic time.

--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

  • Follow-Ups:
    • Re: NSManagedObject, retain count and dealloc:
      • From: vincent habchi <email@hidden>
References: 
 >NSManagedObject, retain count and dealloc: (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: white screen windows at first
  • Next by Date: Re: why doesn't the compiler complain?
  • Previous by thread: Re: NSManagedObject, retain count and dealloc:
  • Next by thread: Re: NSManagedObject, retain count and dealloc:
  • Index(es):
    • Date
    • Thread