我有一批请求构建如下:
for(int i = 0; i < count; i++)
{
RKObjectRequestOperation *operation = [objectManager appropriateObjectRequestOperationWithObject:nil method:RKRequestMethodPOST path:@"sync.json" parameters: nil];
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)
{
}
failure:^(RKObjectRequestOperation *operation, NSError *error) {
}];
[objectManager enqueueObjectRequestOperation:operation];
[operation waitUntilFinished];
}
在继续之前,代码应该停止并等待每个操作。
如果出现问题,如何停止或更确切地删除所有排队的操作?
也许使用cancelAllObjectRequestOperationsWithMethod
?
[编辑]
在Restkit 0.20中,最好使用objectManager postObject:reqObj
...