• 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: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??


  • Subject: Re: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??
  • From: j o a r <email@hidden>
  • Date: Tue, 26 Jul 2005 00:27:30 +0200


On 26 jul 2005, at 00.04, Jerry Krinock wrote:

When I -alloc] init] an NSURLConnection, the result has a retain count of 3
instead of 1.

This is something of a FAQ item. Tracking the retain count like you do is not an effective way to find memory leaks, or to learn about memory management and memory management problems in Cocoa. Think about your own balancing of calls to retain / release (be it via retain / release, or via alloc, autorelease, copy, et.c.), not about the specific retain count of an object at some point in time. It is VERY uncommon to find memory leak in the frameworks (if that's what you're getting at), as they are used by so many developers. What you're seeing is most likely an effect of autorelease.


Read the documentation, and the many good third party articles, to get up to speed on Cocoa memory management.

This makes it makes it really confusing later when I want to get rid of it.

No, because you should only worry about balancing your own retain / release events.


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

References: 
 >A newly alloc] init]ed NSURLConnection has retainCount = 3 ?? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??
  • Next by Date: Re: Which Frameworks? /Developer/SDK 10.4/System/Library/Frameworks vs System/Library/Frameworks
  • Previous by thread: Re: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??
  • Next by thread: Can I use resource in cocoa library?
  • Index(es):
    • Date
    • Thread