Re: A newly alloc] init]ed NSURLConnection has retainCount = 3 ??
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