objective c - Unable to change value of string from @property -
i have variable multiple methods need access , change.
i have declared as:
@property (nonatomic, retain) nsstring *curdate;
i synthesise in code well.
however, when trying change it's value so:
curdate = "02-07-2012";
the app crashes.
why this? how should change value?
you need use @
symbol when using nsstring
literal syntax.
like this:
curdate = @"02-07-2012";
read usage of @
symbol in objective-c here.
Comments
Post a Comment