Re: Some confusion on memory management
Re: Some confusion on memory management
- Subject: Re: Some confusion on memory management
- From: Andy Armstrong <email@hidden>
- Date: Fri, 20 Jan 2006 15:38:42 +0000
On 20 Jan 2006, at 15:32, Jeff Gilbert wrote:
Instead, you want to make your own private copy of the value of
newString so that you can control the lifetime of the string. So,
you would do something like this:
- (void)setMyString:(NSString *)newString
{
[myString release]; // forget about the old value of myString
myString = [newString copy];
}
Although if you knew the string you were storing was immutable you
could just retain a reference to it.
--
Andy Armstrong, hexten.net
_______________________________________________
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