murze murze - 5 months ago 9
Objective-C Question

How to append a string to NSMutableString

i'm an absolute newbie with objective-c

with this code

NSMutableString *teststring;
[teststring appendString:@"hey"];
NSLog(teststring);


nothing gets displayed in the console.

Surely i'm doing something wrong here... :-)

Answer

Change first line to

NSMutableString *teststring = [NSMutableString string];