在RKObjectManager中此对象的POST / PUT请求失败时,如何丢弃对NSManagedObject的实例所做的CoreData更改?
NSManagedObject *object = ...; [object setValue:@"test" forKey: @"test"]; [[RKObjectManager sharedManager] postObject:object parameters:nil success:^(RKObjectRequestOperation *operation,RKMappingResult *mappingResult) { NSLog(@"success,nothing to do"); } failure:^(RKObjectRequestOperation *operation,NSError *error) { // I want to discard changes made to object here }
更新:RestKit 0.20