Objective-c string appending causes exception
- by Dave C
Hello Everyone,
The following code is causing me some problems. The third line causes a program crash... it doesn't happen the first time I step through but somehow later on in the program. If I comment out that third line, the program runs smoothly.
NSString *myRequestString = @"text";
int i = 1;
myRequestString = [myRequestString stringByAppendingString:[NSString stringWithFormat: @"t=%d", i]];
That code causes this exception:
* -[CFString release]: message sent to deallocated instance 0xb4c43fe0
On a side note, can anyone tell me how to concatenate strings in objective-c like any other normal language... I can't believe that there is no concatenation operator.
Any and all help is greatly appreciated.