Re: Instruments leaks.
Re: Instruments leaks.
- Subject: Re: Instruments leaks.
- From: "Michael Ash" <email@hidden>
- Date: Sun, 12 Oct 2008 17:50:17 -0400
On Sun, Oct 12, 2008 at 12:08 PM, Fritz Anderson
<email@hidden> wrote:
> On 12 Oct 2008, at 10:00 AM, Sandro Noel wrote:
>
>> but i wonder, will the variable automatically be released when it falls
>> out of scope? i don't think so but i might be wrong.
>> i'll have to look it up in the doc again :)
>
> No. It will not be automatically released, unless you use garbage collection
Note that this is not the case. It will be automatically
*deallocated*, but it will not be automatically released.
This is kind of pedantic, but I think it's important. In the context
of Cocoa, "release" means to decrement the reference count. It does
*not* mean to deallocate the object. (Although deallocation is
sometimes a consequence.) I think this is important because one of the
most common errors I see Cocoa newbies making is confusing "release"
with "dealloc". They are very different and the two terms and methods
are not interchangeable.
I know what you meant, but just for the sake of accuracy, I wanted to
point out the above.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden