alex
alex

Reputation: 879

Put a nsmutablestring into a other nsmutablestring

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?

Upvotes: 0

Views: 141

Answers (1)

kennytm
kennytm

Reputation: 523304

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

[mutableStringA setString:mutableStringB];

Upvotes: 2

Related Questions