stringByAppendingString issues in objective c

objective-c

Solution

nevermind... i figured out why. The problem is, when you want to use stringByAppendingString on a string, the string should have initial value.

Wrong example:

NSString *str1;
str1 = [str1 stringByAppendingString:@"test"];

Should be:

NSString *str1 = @"";
str1 = [str1 stringByAppendingString:@"test"];

Problem

``` NSString *tmpStr = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]; xmlSms = [xmlSms stringByAppendingString:tmpStr]; NSLog(xmlSms); ``` I got code above but `NSLog` doesn't show anything... Anybody know the problem??

Original source