本文主要是介绍-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:
错误:NSMutableDictionary*d =[[[NSUserDefaults standardUserDefaults] objectForKey:@"xxxx"] mutableCopy];
修改:
NSMutableDictionary*d =[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults]ValueForKey:@"xxxx
"]];
这里在plist里读取相关的数据后 没有alloc 崩溃的话 可能是因为这块指针指向的问题
这篇关于-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!