iOS5 核心数据获取冻结应用程序
从iOS5开始,我的应用程序在使用fetchedResultsController
时开始冻结。我在退出模拟器后附上了调试器结果。
任何帮助将不胜感激。
谢谢
Starting from iOS5, my app started to freeze when using fetchedResultsController
. I have attached the debugger result after quitting the simulator.
Any help will be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在评论中说您正在使用
performSelectorInBackground:
来更新表格视图。这是不对的,所有影响 UI 的代码都应该在主线程上执行。另外(我认为这就是导致问题的原因)你不能跨线程重用 MOC。每个线程必须有自己的 MOC,然后可以使用相同的 NSPercientStoreCoordinator。
您应该阅读 Apple 有关此主题的指南。
You say in the comments that you're using
performSelectorInBackground:
to update tableviews. This isn't right, all code affecting the UI should be executed on the main thread.In addition (and I think this is what's causing the problem) you mustn't reuse a MOC across threads. Each thread must have its own MOC, which can then use the same
NSPersistentStoreCoordinator
.You should read Apple's guide on this topic.