How can I solve NSInternalInconsistencyException', reason: '+entityForName: fail report

此生再无相见时 提交于 2019-12-01 21:09:32

Change the code in fetchedResultsController :

NSEntityDescription *entity = [NSEntityDescription entityForName:@"Obrat" inManagedObjectContext:self.managedObjectContext];

to

NSEntityDescription *entity = [NSEntityDescription entityForName:@"Obrta" inManagedObjectContext:self.managedObjectContext];

Entity named you create with Xcode must keep same with the NSEntityDescription in your code

You say you have an entity named "Obrta", but the code is creating an object of type "Obrat". Fixing that typo should fix your issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!