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

Re: NSTextView retainCount weirdness


  • Subject: Re: NSTextView retainCount weirdness
  • From: Nicko van Someren <email@hidden>
  • Date: Fri, 8 Jul 2005 11:17:44 +0100

On 8 Jul 2005, at 7:08, j o a r wrote:

On 8 jul 2005, at 07.04, Duncan Campbell wrote:

If I do the following:

    NSTextView *foo = [[NSTextView alloc] init];
    NSLog(@"foo: %i",[foo retainCount]);

I get a retainCount of 3. Can someone explain why?

Very rarely does it make sense for you to try to track the actual value of the retain count for an object in this way. Objects can be retained and released for reasons that are an implementation detail of their design that might not be immediately obvious to you. In this particular case, it's likely that you're seeing the effect of retain+autorelease, and that the net retain count of this object is still in reality 1.

Apropos of this, is there a straight forward way to find out the count of pending (auto) releases on an object?


    Nicko


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSTextView retainCount weirdness
      • From: j o a r <email@hidden>
References: 
 >NSTextView retainCount weirdness (From: Duncan Campbell <email@hidden>)
 >Re: NSTextView retainCount weirdness (From: j o a r <email@hidden>)

  • Prev by Date: Re: NO future for Cocoa-Java ?
  • Next by Date: Re: NSTextView retainCount weirdness
  • Previous by thread: Re: NSTextView retainCount weirdness
  • Next by thread: Re: NSTextView retainCount weirdness
  • Index(es):
    • Date
    • Thread