stringByAppendingString question. - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: stringByAppendingString question. (/thread-3204.html)
stringByAppendingString question. - hypnotx - Jun 29, 2007 02:15 PM
What am I doing wrong here? The code I am testing compiles and runs but I end up with an empty string for gameNumberList. The line in question is:
stringByAppendingString question. - longjumper - Jun 29, 2007 03:50 PM
gameNumberList = [NSMutableString alloc];
gameNumberList = [[NSMutableString alloc] init];
stringByAppendingString question. - hypnotx - Jun 29, 2007 04:08 PM
Caught that right after posting but I still do not get anything when trying:
Watching it in debug and everything is fine just nothing goes into gameNumberList. I am wondering if I should be appending the string differently.
stringByAppendingString question. - Cochrane - Jun 30, 2007 03:13 AM
I'm willing to bet that stringByAppendingString is working perfectly here, it's just not what you want to use in the first place. stringByAppendingString returns a new string, but it doesn't change the target. You want appendString: instead.
stringByAppendingString question. - hypnotx - Jul 3, 2007 11:29 AM
Yep. appendString: seems to work. Course now I have an infinite loop to fix but getting a little closer. Thanks.