Yes of course. NSMutableString is NSString, so your code is absolutely correct, with the exception of some syntax errors (you skipped *on each NSStringand [ ]in the instructions if. You should write:
NSString *string1 = @"Hello world";
NSMutableString *string2 = [NSMutableString stringWithString:string1];
if ([string1 isEqualToString:string2])
{
}
source
share