nsmutablestring 属性声明为copy程序崩溃了

obj.mutableStr = (NSMutableString *)[[NSMutableString alloc] initWithString:@"Hello"];

NSLog(@"%@", obj.mutableStr);

[obj.mutableStr appendString:@"World!"]; // crash here: Attempt to mutate immutable object with appendString:
NSLog(@"%@", obj.mutableStr);
我这个属性声明为copy,程序崩了

posted @ 2013-11-25 17:44  如来藏  阅读(324)  评论(0编辑  收藏  举报