我想将数据保存到CoreData,但是我得到了下一个错误:
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<NSEntityDescription 0x7fc428f75940> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key username.'
这是我的密码:
let appDelegate: AppDelegate
当我试图从核心数据中获取超过1000个NSManagedObjects时,我的应用程序崩溃,并显示以下消息:
error: (1) I/O error for database at .../Documents/Stores/Model.sqlite.
SQLite error code:1, 'Expression tree is too large (maximum depth 1000)'
CoreData: error: (1) I/O error for database at .../Documents/Stores/Model.sqlite.
SQLite
我是新手,我正在尝试创建一种缓存机制,在解析来自CoreData的对象后,我将它们保存到数据模型中,然后再次获取它以在表视图上显示它。我正在尝试使用NSFetchedResultsController获取它。在初始化NSFetchedResultsController时,我遇到了这个运行时异常:
2018-12-09 15:03:20.493509+0800 [5184:148001] [error] error:
No NSEntityDescriptions in any model claim the NSManagedObject subclass
'Product'
我正在尝试获取用户列表,这些用户的名称是从表视图中选择的,并存储在所选的数组中。
我的代码出了什么问题?对不起,这是我第一次使用CoreData,所以我真的不知道出了什么问题。
NSFetchRequest *request= [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"AUser" inManagedObjectContext:_managedObjectContext];
for (id a in selected) {