Re: question about retain/release
Re: question about retain/release
- Subject: Re: question about retain/release
- From: Robert Cerny <email@hidden>
- Date: Mon, 22 Dec 2003 20:14:44 +0100
Hi,
you're responsible for releasing of objects you actually create. You
didn't create newTitle in the displayed method, so you don't release
it.
HTH
Robert
On 22.12.2003, at 18:46, Thierry Bucco wrote:
>
Hi evereybody,
>
>
I have a little question.
>
>
I am reading some documentations about management
>
(http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
>
Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043/1000580).
>
>
There is a setter function like this one :
>
>
- (void) setTitle: (NSString*) newTitle
>
{
>
if (newTitle != title)
>
{
>
[title release];
>
title = [newtitle retain];
>
}
>
}
>
>
In several documentation I have read that I have to release every
>
object I allocate, copy or retain.
>
So, why newTitle isn't released on this example ?
>
>
Thanks.
>
>
thierry
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.