0

当我尝试保存核心数据时,我进入了控制台:

未解决的错误 (null), (null)

- (void)saveInManagedObjectContext:(NSManagedObjectContext *)context {

    if (context == nil) {

        // Use default MOC
        context = self.managedObjectContext;

        NSError *error = nil;

        if ([context hasChanges] && ![context save:&error])
        {
            /*
             Replace this implementation with code to handle the error appropriately.

             abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
             */
            DLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        }

    }
}

NSErrorobject 是nil.

我该怎么做才能获得更多有用的信息,为什么保存操作不成功?

4

0 回答 0