copy and mutableCopy of NSMutableString

For NSMutableString AND NSString

say we have:

If you use

it will return you an immutable object (NSString*) with its own address. This means you cannot change the data.
Hence, even if you declare a NSMutableString pointer, and use setString to change the data, the compiler will give you an exception.

if you use [temp mutableCopy], it will return an mutable object (NSMutableString*) with its own address.
However, be sure that you declare a NSMutableString * so that you can use setString to change the data and see the difference.