iOS5 核心数据获取冻结应用程序

发布于 2024-12-27 21:57:30 字数 183 浏览 2 评论 0原文

从iOS5开始,我的应用程序在使用fetchedResultsController时开始冻结。我在退出模拟器后附上了调试器结果。

在此处输入图像描述

任何帮助将不胜感激。

谢谢

Starting from iOS5, my app started to freeze when using fetchedResultsController. I have attached the debugger result after quitting the simulator.

enter image description here

Any help will be appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十级心震 2025-01-03 21:57:30

您在评论中说您正在使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文