2014-09-19 104 views
0

在我的APP中,我有一个非常简单的模型,只有两个类。其中之一是CDAttribute。 CDAttribute'NSInternalInconsistencyException',原因:不是NSManagedObject的子类。'

此应用在商店中正在使用。现在我用xCode 6测试了它的第一次,并将它的新版本放到了我的iPad上。现在,我得到这个错误

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '"CDAttribute" is not a subclass of NSManagedObject.' 
*** First throw call stack: 
(0x18342e084 0x193e800e4 0x1830f5350 0x183113f94 0x10004450c 0x100043410 0x1833d4434 0x1833137e0 0x18420b6c0 0x10003f758 0x187e3f104 0x187e432dc 0x187e47624 0x187e46b00 0x187e46a58 0x187e3a38c 0x18b605640 0x1833e6360 0x1833e5468 0x1833e3a8c 0x183311664 0x18c41f5a4 0x187c16984 0x10004d0a0 0x1944eea08) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

调用此机能的研究

CDAttribute *attr = (CDAttribute *)[NSEntityDescription insertNewObjectForEntityForName:@"CDAttribute" inManagedObjectContext:self.managedObjectContext]; 

对此我无法理解,因为我没有碰模型,也不是代码。

回答

0

看起来好像CDAttribute保留在iOS8中。我改变了Classname(不是模型中的表名,因为那时我可能会把所有的条目都丢失,当我更新到这个版本时)到SIAttribute并且它工作。

这是解决方案,但是如果它真的被保留并记录在案,我会感兴趣。