Re: Invalid value of the string instance variables
Re: Invalid value of the string instance variables
- Subject: Re: Invalid value of the string instance variables
- From: Frederick Cheung <email@hidden>
- Date: Mon, 31 Jan 2005 12:10:13 +0000
On 31 Jan 2005, at 08:57, Tan Dung Ho wrote:
I implemented the AppController classs in my project. It had a
instance variable which declared NSString (NSString* strValue,..) and
the method to set value:
-(void)setStrValue: (NSString*)value
{
strValue = [NSString stringWithString:value];
}
stringWithString retuns an autoreleased object, which you are not
retaining, so at some point in the near future strValue will be
released and you are left with a pointer pointing at garbage.
Fred
_______________________________________________
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