Alex Rivera | Logout

How to append a NSMutableString with a NSMutableString?

Asked 2010-08-30T11:42:53.837
11
NSMutableString *str, *str1;

//allocation here

i am using [str appendString:str1] is not working. [str appendFormat:str1] is not working.

So, how to append a NSMutableString with another NSMutableString.

@str is an empty string initialize to nil. str1 has some value. [str appendString str1] returns null

Edit
Report

1 Answer

0
NSMutableString *mystring = [NSMutableString stringWithFormat:@"pretty"];
    NSMutableString *appending = [NSMutableString stringWithFormat:@"face"];
    [mystring appendString:appending];

works for me...

are you sure the variables have been allocated (correctly?)? No misspellings?

answered 2010-08-30T11:59:25.507

Your Answer