*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'
初始代码
NSMutableDictionary *dataDict=[[NSMutableDictionary alloc]init];
dataDict=responseObject[@"post"];
NSString *str=dataDict[@"content"];
str=[self handleStringWithString:str];
[dataDict setObject:str forKey:@"content"];
这是由于我把不可变的字典赋到可变字典,只要修改为
dataDict= [NSMutableDictionary dictionaryWithDictionary:responseObject[@"post"]];
就可以了。