是否可以重写以下代码使用AFNetworking v 1.6:
__block AFJSONRequestOperation *operation =
[AFJSONRequestOperation
JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
[self uploadFinished:JSON completionBlock:completion failureBlock:failure];
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
[self uploadFailedWithError:error completionBlock:completion failureBlock:failure];
[UIApplication hideProgressLoading];
}];
[operation
setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
[UIApplication updateProgress:totalBytesWritten * 1.0/totalBytesExpectedToWrite];
}];
[operation start];
到AFNetworking 3.1版本?