Downloading multiple files in iphone app(Objective c)

cocoa, cocoa-touch, iphone

Solution

I've done this before when I wanted to download 10 XML files at the same time (it was much faster than queuing them to download one after the other). I used the libraries found here:

http://github.com/leonho/iphone-libs/tree/master

They were easy to implement and there's some example code on the front page to get you started.

self.urls = [NSMutableArray arrayWithObjects:
    @"http://maps.google.com/maps/geo?output=json&q=Lai+Chi+Kok,Hong+Kong",
    @"http://maps.google.com/maps/geo?output=json&q=Central,Hong+Kong",
    @"http://maps.google.com/maps/geo?output=json&q=Wan+Chai,Hong+Kong",
    nil];

self.downloads = [[MultipleDownload alloc] initWithUrls: urls];
self.downloads.delegate = self;

Good luck.

Problem

In my iPhone app I want to download multiple files which are on IIS with authentication. On a button click i want to start the downloading process. I know how to download a file with authentication. ``` NSURLRequest* request = [NSURLRequest requestWithURL:mMovieURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; movieConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self ]; ``` and i have couple of delegate methods with the above code. But how to do it with mutliple downlaods going at the same time. Thanks,

Original source