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: Magnus Strand <email@hidden>
- Date: Mon, 31 Jan 2005 10:42:41 +0100
Hi Tan,
Try declaring strValue as NSMutableString* instead.
Then you can change it with setString: instead of creating a new
string every time which[NSString stringWithString:value] does.
Regards,
Magnus
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];
}
The setStrValue's called by other object. This object has a instant
variable point to AppController.
In the AppController class, I wrote a method named "processString" to
process "strValue" variable. It is no problem when I call
processString method. But if this method was called in action method
(eg. (IBAction)buttonClicked:(id)sender), it cause a problem when
access value of strValue varable although it was set before.
I debug step-by-step my program and show all values of instant
variables during debuging. strValue's "invalid" value but its address
was valid.
Anybody tell me this problem?
Thank in advance.
Tan Dung
_______________________________________________
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
--
Med vänliga hälsningar
Magnus Strand
System Developer, MSc
email@hidden
Direct: +46 40 601 57 16
Office: +46 40 601 57 00
Mobile: +46 704 20 57 16
Teknik i Media AB
Södra Förstadsgatan 2
SE-211 43 Malmö
Sweden
_______________________________________________
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