您好。我正在使用ASIFormDataRequest将图像上传到服务器。我想取消上传图片的选项,所以我试图取消所有上传请求,但它似乎没有用。
这是我的代码:
if (asiRequest) {
NSLog(@"cancel call");
[asiRequest cancel];
asiRequest.delegate = nil;
asiRequest.uploadProgressDelegate = nil;
asiRequest = nil;
progressbar.hidden=YES;
uploadinglbl.hidden=YES;
photosCountlbl.hidden=YES;
[self.spinner stopAnimating];
//[self.navigationController popViewControllerAnimated:YES];
}
任何人都可以帮助我取消所有请求吗?
提前致谢。
答案 0 :(得分:0)
if(![asiRequest isCancelled]) {
// Cancels an asynchronous request
[asiRequest cancel];
// Cancels an asynchronous request, clearing all delegates and blocks first
[asiRequest clearDelegatesAndCancel];
}