NSMutableString is a subclass of NSString , so you can just give it:
NSString *string = (NSString *)mutableString;
In this case, string will be an alias of mutalbeString , but the compiler will complain if you try to call any mutable methods on it.
Alternatively, you can create a new NSString using the class method:
NSString *string = [NSString stringWithString:mutableString];
Jose Ibanez Apr 07 2018-11-11T00: 00Z
source share