0

managedObjects を保存しました。しかし、私の NSManagedObjectID は保存後も一時的なものです。なんで?

dispatch_async(privateQueue, ^{
    __block NSMutableArray *ids = [NSMutableArray array];

    [[[LPAppDelegate instance] privateContext] performBlockAndWait:^{

        if ([responseObject isKindOfClass:[NSDictionary class]]) {
            id arr = ((NSDictionary*)responseObject)[@"results"];
            for (int i=0; i < ((NSArray *)arr).count; i++) {
                LPFilm *film = [LPFilm MR_createEntityInContext:privateContext];
                [ids addObject:film.objectID];
            }
        }

        NSError *error = nil;
        [privateContext save:&error];
        if (error) {
            NSLog(@"___fetch service error: %@", [error localizedDescription]);
        }
    }];


    for (NSManagedObjectID *objID in ids) {
        if (objID.isTemporaryID) {
            NSLog(@"__tempID %@", objID);
        }
    }
});
4

1 に答える 1