trying to save NSManagedObjectContext not working
问题 I have been trying to figure out this problem for 2 days now. I keep getting an error when I try to save. //self.data is NSManagedObject. kAppDelegate.moc is the managed object context. self.data = [NSEntityDescription insertNewObjectForEntityForName:@"Data" inManagedObjectContext:kAppDelegate.moc]; [self.data setValue:[NSNumber numberWithBool:NO] forKey:@"isit"]; [self.data setValue:@"" forKey:@"name"]; NSError *error; if(![self.data.managedObjectContext save:&error]) { NSLog(@"Save did not