リクエストを作成し、Core Dataに応答を入れようとすると、次のエラーが発生します。
Performing managed object mapping with a nil managed object cache:
Unable to update existing object instances by identification attributes. Duplicate objects may be created.
identifactionAttributesを設定し、ObjectManagerを使用してリクエスト操作を構成しています。そして、私はまだ「既存のオブジェクトインスタンスを更新できません...」を受け取ります
objectMapping = [RKEntityMapping mappingForEntityForName:@"Entity" inManagedObjectStore:self.managedObjectStore];
objectMapping.identificationAttributes = @[ @"route_id" ];
[objectMapping addAttributeMappingsFromDictionary:@{
@"point_alt" : @"point_alt",
@"point_lat" : @"point_lat",
@"point_long" : @"point_long",
@"location_id" : @"location_id",
@"route_id" : @"route_id"
}];
NSMutableURLRequest *request = [[RKObjectManager sharedManager] requestWithObject:nil method:RKRequestMethodPOST path:path parameters:paramsWithEncr];
RKManagedObjectRequestOperation *operation = [[RKObjectManager sharedManager] managedObjectRequestOperationWithRequest:request managedObjectContext:self.managedObjectStore.mainQueueManagedObjectContext success:^(RKObjectRequestOperation *operation, RKMappingResult *result) {
NSLog(@"Loading mapping result: %d", result.count);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"Fail!");
}];