Okay so here’s my problem.
I have a two global NSString variables.
globalVariable1 //stores one string.
globalVariable2 //stores 3 strings
globalVariable2 is concatenated using
[NSString stringWithFormat:@"%@, %@, %@", Item1, Item2, Item3];
I assign
[textField setText:globalVariable1] //NO ERROR //
but
[textField setText:globalVariable2] // ERROR //
Could anyone tell me what is going on ?
You probably aren’t retaining
globalVariable2. Since thestringWithFormat:method will return an autoreleased object, you need to retain it after you assign it.