'+entityForName: nil is not a legal NSManagedObjectContext parameter - Core Data

后端 未结 8 709
梦如初夏
梦如初夏 2020-11-28 22:26

I have added all of the relevant code to the App Delegate, and I am able to add to the data model and fetch from the data model in applicationDidFinishLaunchingWithOptions.<

8条回答
  •  一整个雨季
    2020-11-28 23:02

    you should add this to your viewController:

     id delegate = [[UIApplication sharedApplication] delegate];
        self.managedObjectContext = [delegate managedObjectContext];
    

提交回复
热议问题