• 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: j o a r <email@hidden>
  • Date: Fri, 8 Jul 2005 08:08:01 +0200


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.


And the question that always needs to be asked: What are you *really* trying to accomplish here?

j o a r



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Nicko van Someren <email@hidden>
References: 
 >NSTextView retainCount weirdness (From: Duncan Campbell <email@hidden>)

  • Prev by Date: Re: Cocoa classes question
  • Next by Date: Re: [Cocoa-Java] WebView and HTML string how to ?
  • Previous by thread: NSTextView retainCount weirdness
  • Next by thread: Re: NSTextView retainCount weirdness
  • Index(es):
    • Date
    • Thread