You can set NSMutableString to NSString, but not vice versa.
NSString *str = [NSMutableString alloc]init];
ok but
NSMutableString *str = [[NSString alloc]init];
not. This is because NSMutableString is a subclass of NSString, so it is an "NSString". However, you can create a mutable string from NSString with
NSMutableString *mStr = [str mutableCopy];
Joe cannatti
source share