ASIHTTP: addOperation when other threads are running
- by user262325
Hello everyone
I have a project using ASIHTTP to multi download files from a site
when I add a new request:
[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];
it reported:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[ASINetworkQueue addOperation:]: operation is executing and cannot be enqueued'
It looks like I can not add a new request when others are running.
Welcome any comment
Thanks
interdev