相关疑难解决方法(0)

在任何模型中,没有NSEntityDescriptions声明NSManagedObject子类

我是CoreData的新手,我正在尝试创建一种缓存机制,其中从API解析对象之后,将它们保存到数据模型中,然后再次获取它以在tableview上显示它。我正在尝试使用获取它NSFetchedResultsController。在初始化时NSFetchedResultsController,我遇到了以下运行时异常:

2018-12-09 15:03:20.493509+0800 [5184:148001] [error] error: 
No NSEntityDescriptions in any model claim the NSManagedObject subclass 
'Product' so +entity is confused.  Have you loaded your 
NSManagedObjectModel yet ?
CoreData: error: No NSEntityDescriptions in any model claim the 
NSManagedObject subclass 'Product' so +entity is confused.  Have you 
loaded your NSManagedObjectModel yet ?
2018-12-09 15:03:20.493718+0800[5184:148001] [error] error: + 
[Product entity] Failed to find a unique match for an 
NSEntityDescription to a managed object subclass
CoreData: error: +[Product entity] Failed …
Run Code Online (Sandbox Code Playgroud)

ios swift

5
推荐指数
6
解决办法
3064
查看次数

标签 统计

ios ×1

swift ×1