ERROR for attempting mutating immutable object
问题 What is this error? I am using mutable type but still it is not working! ERROR IS : Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'mutate immutable object with deleteCharactersInRange:' NSMutableString *line= [NSMutableString stringWithString:@"here is the string"]; [line deleteCharactersInRange: NSMakeRange(1,9 )]; 回答1: My new answer: With your new code, I added one extra line at the end: NSMutableString *line= [NSMutableString stringWithString:@"here is the