消息发送到已释放的实例 - NSUserDefaults
我有一个奇怪的问题。这种情况突然开始发生在以前没有问题的代码中。
我有一个像这样的简单代码:
[[NSUserDefaults standardUserDefaults] setObject:viewControllersList forKey:kViewControllersKey];
[[NSUserDefaults standardUserDefaults] synchronize];
我将一些信息保存到 UserDefaults 中(用于状态保存)。
今天突然在这段代码的第一行我开始收到
*** -[CFDictionary isNSDictionary__]: message sent to deallocated instance 0x65bc5d0
它几乎总是发生,但不完全是这样。如果我从模拟器中删除应用程序,清理项目并重建/运行,那么它就可以工作。如果我停止应用程序并重新启动 - 错误又回来了。
我完全被困在这个问题上。有什么想法吗?
I've got a strange issue. This is suddenly started happening in the code that used to work with no problem.
I have a simple code like this:
[[NSUserDefaults standardUserDefaults] setObject:viewControllersList forKey:kViewControllersKey];
[[NSUserDefaults standardUserDefaults] synchronize];
Where I'm saving some info into the UserDefaults (for state preservation).
All of a sudden today on the first line of this code I started receiving
*** -[CFDictionary isNSDictionary__]: message sent to deallocated instance 0x65bc5d0
It happens almost always, but not quite. If I delete the app from the simulator, clean the project and rebuild/run, then it works. If I stop the app and re-start - the error is back.
I'm totally stuck at this. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试添加
NSDictionary
(viewControllersList
),但此NSDictionary
已发布You ar trying to add a
NSDictionary
(viewControllersList
) but thisNSDictionary
is already released