我必須使用ASIHTTP多下載文件從網站ASIHTTP:addOperation當其他線程正在運行
一個項目,當我添加了新的要求:
[networkQueue cancelAllOperations];
[networkQueue setDownloadProgressDelegate:a];
[networkQueue setDelegate:self];
[networkQueue setRequestDidFinishSelector:@selector(requestDone:)];
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
[networkQueue addOperation:request];
[networkQueue go];
它報道:
*由於未捕獲的異常'NSInvalidArgumentException'而終止應用程序,原因:'* - [ASINetworkQueue addOperation:]:正在執行並且無法排隊的操作'
看起來我不能在別人正在運行時添加新的請求。
歡迎任何評論
感謝
InterDev中