保存核心数据上下文时,出现以下错误。 我真的不知道从哪里开始看,如果你有一个领导... 谢谢。CoreData误解对象类
PS:我检查了.h文件中声明的所有类型与我的数据模型中的相同。
编辑:我覆盖了NSDate类intValue。现在我看到timeIntervalSinceReferenceDate在NSNumber上被调用。我试图在那里放置一个断点,但它没有提供任何信息(只保存:在我的代码之前)。我还发现了一种方法来知道谁是那些着名的对象:NSDate是一个对象(称为lastCompute)与NSNumber(称为sleep)在同一个类中。它们的类型匹配在.h和数据模型中声明的类型。但是它没有给我提示为什么CoreData在NSDate上调用intValue。任何主角?由于
-[__NSDate intValue]: unrecognized selector sent to instance 0x6a3cba0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDate intValue]: unrecognized selector sent to instance 0x6a3cba0'
*** Call stack at first throw:
(
0 CoreFoundation 0x01ca35a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01df7313 objc_exception_throw + 44
2 CoreFoundation 0x01ca50bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01c14966 ___forwarding___ + 966
4 CoreFoundation 0x01c14522 _CF_forwarding_prep_0 + 50
5 CoreData 0x00955b50 -[NSSQLiteConnection execute] + 2320
6 CoreData 0x009a7ebd -[NSSQLiteConnection updateRow:] + 365
7 CoreData 0x009a6e64 -[NSSQLConnection performAdapterOperations:] + 180
8 CoreData 0x009a6b0e -[NSSQLCore _performChangesWithAdapterOps:] + 494
9 CoreData 0x009a55ea -[NSSQLCore performChanges] + 410
10 CoreData 0x0099f038 -[NSSQLCore saveChanges:] + 216
11 CoreData 0x0095d199 -[NSSQLCore executeRequest:withContext:error:] + 409
12 CoreData 0x00a0d70b -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 3691
13 CoreData 0x00995948 -[NSManagedObjectContext save:] + 712
一些代码在哪里实际上可以节省? – Eimantas
是的,没有人可以真正解释这个以及代码。 – darksky
- [__ NSDate intValue]:无法识别的选择器SAYS IT ALL。 NSDate对象没有intValue函数。 – Zigglzworth