-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:

来源:互联网 发布:美工设计网站大全 编辑:程序博客网 时间:2024/05/21 18:39

http://qqy620.diandian.com/post/2012-10-15/40039809949 

-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:

错误:NSMutableDictionary*d =[[[NSUserDefaults standardUserDefaults] objectForKey:@"xxxx"] mutableCopy];
修改:NSMutableDictionary*d =[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] ForKey:@"xxxx"]];
0 0