0
在我的APP中,我有一個非常簡單的模型,只有兩個類。其中之一是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];
對此我無法理解,因爲我沒有碰模型,也不是代碼。