Re: I think I get most of the memory stuff but...
Re: I think I get most of the memory stuff but...
- Subject: Re: I think I get most of the memory stuff but...
- From: "Tony S. Wu" <email@hidden>
- Date: Sun, 4 May 2003 19:04:20 -0700
Imagine if clientCode and aString is the same object and you didn't
retain aString first.
Yes, when you are going to retain it, it's already released.
Tony S. Wu
email@hidden
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu - My web page.
On Sunday, May 4, 2003, at 06:41 PM, Theodore Petrosky wrote:
These conversations on memory management are useful
but one issue has never been discussed. why do I have
to retain a passed in value.
in a common setter....
-(void)setClientCode:(NSString *) aString {
[aString retain];
[clientCode release];
clientCode=aString;
}
I assume that aString is a convenience construct that
is autoreleased. Why do I have to retain it? Why
doesn't it live through the method? I finally
understand the autorelease mechanics. I just do get
why I need to retain aString.
Ted
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
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.
_______________________________________________
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.