ios - 无法从此 NSManagedObjectContext 的协调器访问对象的持久存储
问题描述
我在 iOS 12.0.1 上有以下崩溃日志:
Object's persistent store is not reachable from this NSManagedObjectContext's coordinator
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x1dae1bef8 __exceptionPreprocess
1 libobjc.A.dylib 0x1d9fe9a40 objc_exception_throw
2 CoreData 0x1dda6f828 _PFRetainedObjectIDCore
3 CoreData 0x1dd9a3238 -[NSManagedObjectContext objectWithID:]
如果我不重置持久存储,这怎么可能?
解决方案
Found your question and it is 100% similar to the crash I'm observing but have no idea how it might be fixed. The object is accessed from the main tread while it estimates the cells heights on the device rotation. I think that might be happening when the app is going to the background.
2 CoreData _PFRetainedObjectIDCore
3 CoreData -[NSManagedObjectContext objectWithID:]
4 CoreData _faultBatchAtIndex
5 CoreData -[_PFBatchFaultingArray retainedObjectAtIndex:]
6 CoreData -[_PFBatchFaultingArray objectAtIndex:]
7 CoreData -[NSFetchedResultsController objectAtIndexPath:]
9 UIKitCore -[UITableView _estimatedHeightForRowAtIndexPath:]
10 UIKitCore __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke
11 UIKitCore -[UISectionRowData refreshWithSection:tableView:tableViewRowData:]
12 UIKitCore -[UITableViewRowData numberOfRows]
13 UIKitCore -[UITableView noteNumberOfRowsChanged]
14 UIKitCore -[UITableView reloadData]
推荐阅读
- android-studio - 如何在 Flutter 的 onPressed 方法中获取 radioButton 值
- python - “charmap”编解码器无法解码位置 5697 中的字节 0x9d:字符映射到
- c++ - 尝试打开目录进行读取时,CreateFile 总是返回错误 5(访问被拒绝)
- javascript - 收银机免费代码营算法需要帮助
- java - 尽管在同一个包和一个扫描组件中,但 Spring 未检测到组件
- java - java DateFormat - 获取印度的默认日期模式为 DD-MM-YY
- nginx - 如何从 Nginx 的基本身份验证中排除路由?
- typescript - Axios + Typescript:如何传递“ResponseType”类型的参数?
- android - VPNService 权限对话框是否可以通过?
- android - 如何将数据库从内部存储复制到外部存储(假设是下载文件夹)?