I want to use the ASIHttprequest library to download some files, I am testing with their code and it is not working while the same code works on their sample
this is my code to call their view
QueueViewController *queueViewController = [[QueueViewController alloc] initWithNibName:@"Queue" bundle:nil]; [self.view addSubview:queueViewController.view];
This the code to make the request
- (IBAction)fetchThreeImages:(id)sender
{
[imageView1 setImage:nil];
[imageView2 setImage:nil];
[imageView3 setImage:nil];
[networkQueue cancelAllOperations];
[networkQueue setDownloadProgressDelegate:progressIndicator];
[networkQueue setRequestDidFinishSelector:@selector(imageFetchComplete:)];
[networkQueue setShowAccurateProgress:[accurateProgress isOn]];
[networkQueue setDelegate:self];
ASIHTTPRequest *request;
request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]] autorelease];
[networkQueue addOperation:request];
request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/trailsnetwork.png"]] autorelease];
[networkQueue addOperation:request];
request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/sharedspace20.png"]] autorelease];
[networkQueue addOperation:request];
[networkQueue go];
}
- (void)imageFetchComplete:(ASIHTTPRequest *)request
{
UIImage *img = [UIImage imageWithData:[request responseData]];
if (img) {
if ([imageView1 image]) {
if ([imageView2 image]) {
[imageView3 setImage:img];
} else {
[imageView2 setImage:img];
}
} else {
[imageView1 setImage:img];
}
}
}
It looks like the queue is being setup properly but imageFetchComplete method is not being called when the download is done.