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
You should check if the NSManagedObjectContext object is nil.
e.g.
if (self.managedObjectContext == nil) { NSLog(@"NSManagedObjectContext is nil"); return nil; }