-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法
2015-08-14 16:48
537 查看
-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:
错误:NSMutableDictionaryd =[[[NSUserDefaults standardUserDefaults] objectForKey:@"xxxx"] mutableCopy];
修改:NSMutableDictionaryd =[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults]ValueForKey:@"xxxx"]];
错误:NSMutableDictionaryd =[[[NSUserDefaults standardUserDefaults] objectForKey:@"xxxx"] mutableCopy];
修改:NSMutableDictionaryd =[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults]ValueForKey:@"xxxx"]];
相关文章推荐
- Objective-C:对象之间循环引用会造成死循环
- JS 对象(Object)和字符串(String)互转
- Objective-C:内存管理的小结
- 如何在Ubuntu系统里搭建Objective C学习环境
- Objective-C中copy的使用(深拷贝、浅拷贝详解)
- Objective-c中多线程使用AsyncSocket时报错
- 解决Java编译时的java/lang/NoClassDefFoundError: java/lang/Object 错误
- Objective-C 苹果开发文档 03 Working with Objects
- Large Object Support大对象支持
- python-可变迭代对象在for循环中的风险Risk in FOR loop while looping mutable iterable object
- 【iOS】objective-c2.0之基本数据类型
- 错误: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
- 【Objective-C】代码块(Block)
- Objective-c 中 nil, Nil, NULL和NSNull的区别
- Objective-C中的方法重载与初始化方法
- 《Objective-C基础教程》第10章 对象初始化
- 黑马程序员———API之Object、String和Scanner
- Objective-C 苹果开发文档--02 Defining Classes
- objective-c学习笔记之属性特性(assign , retain , copy , readonly , readwrite , atomic , nonatomic)
- Objective-C 苹果开发文档 01 Introduction