+entityForName: could not locate an entity named '*****' in ****

来源:互联网 发布:怎么在淘宝分期买手机 编辑:程序博客网 时间:2024/04/29 14:37

coreData的教程网上有很多  这里就说一下作为一个初学者  遇到的两大问题

1、+entityForName: could not locate an entity named '*****' in ****这个问题需要你注意一下,



2、

'NSInvalidArgumentException', reason: '+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'CacheModel''

这里是因为你没有实例化这个东西,加上这两句话就可以了


 self.appDelegate = [[UIApplicationsharedApplication] delegate];

        _managedObjectContext = [self.appDelegatemanagedObjectContext];

  



0 0
原创粉丝点击