insertNewObjectForEntityForName:

前端 未结 3 1651
小蘑菇
小蘑菇 2020-12-01 19:24

I set up an Entity using the Xcode .xcdatamodel file editor. I created an entity called Person, added a few attributes, then generated a .m file to represent it. That all

3条回答
  •  既然无缘
    2020-12-01 19:38

    You should check if the NSManagedObjectContext object is nil.

    e.g.

    if (self.managedObjectContext == nil) {
        NSLog(@"NSManagedObjectContext is nil");
        return nil;
    }
    

提交回复
热议问题