• 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: monitoring retainCount
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monitoring retainCount


  • Subject: Re: monitoring retainCount
  • From: Shawn Erickson <email@hidden>
  • Date: Wed, 26 May 2004 20:47:33 -0700

On May 26, 2004, at 4:12 PM, Stefan Fisk wrote:

i think you all are missing the point, i want to monitor the retain count in code, so that i can know when the objects i've created get destroyed, without polling each pass through the runloop etc.. what you're suggesting are debugging aids, i want to be notified atleast every time retainCount changes, preferably only when it reaches 0, and it should work while deployed on "vanilla" installs of os x..

is there any way to monitor retainCount for an object?
i'm writing a file based NSMutableArray subclass, and i would like it
if objectAtIndex: could return the same object throughout the object's
lifetime, to preserve memory etc..

Ok didn't review your original post...

I suggest setting up a object cache that use weak references to the cached object and how those objects send out a notification when they get deallocated or something along those lines. It is not clear what objects you are trying to deal with (your own or not), etc. Anyway consider the following...

<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043/BCICCFAE>

-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: monitoring retainCount (From: "email@hidden" <email@hidden>)
 >Re: monitoring retainCount (From: Shawn Erickson <email@hidden>)
 >Re: monitoring retainCount (From: Stefan Fisk <email@hidden>)

  • Prev by Date: binding NSMenuItem's "enabled"
  • Next by Date: Re: monitoring retainCount
  • Previous by thread: Re: monitoring retainCount
  • Next by thread: Re: NSComboBox and bindings
  • Index(es):
    • Date
    • Thread