views:

26

answers:

1

if I have a nsmutablestring, I can set his string with the method setString. But this method only takes NSString, How I can put a nsmutablestring into my nsmutableString. If I do this: mutableStringA = mutableStringB, this will change the pointer of mutableStringA and not his string value, is it true?

Alex

+2  A: 

NSMutableString inherits from NSString, that means -setString: also works with a mutable string argument.

[mutableStringA setString:mutableStringB];
KennyTM
Ok, because when I try this mutableStringA is nill, but this is may be cause by a other things in my apps, thank you
alex