How to call multiple NSURLConnection delegate & save the downloaded data to different directories



1. Download the source code

2. Add the DKDownload and DKConnection files into your project folder

3. In your view controller add the below methods

-(void)callDKDownloader{
    
 DKDownloader *downloader = [DKDownloader multipleURLConnectionDownloader];
downloader.delegate = self;
 NSString *urlString1 =         @"https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/WhatsNewInOSX.pdf";
 NSString *urlString2 = @"https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/TransitionGuide.pdf";
  NSString *urlString3 = @"https://developer.apple.com/library/mac/documentation/MapKit/Reference/MKTileOverlay_class/MKTileOverlay_class.pdf";
    
NSURL *url_1 =  [NSURL URLWithString:urlString1];
NSURL *url_2 =  [NSURL URLWithString:urlString2];
NSURL *url_3 = [ NSURL URLWithString:urlString3];
    
[downloader startWithURL:url_1 saveWithFileName:@"WhatsNewInOSX" offline:NO];
[downloader startWithURL:url_2 saveWithFileName:@"TransitionGuide" offline:NO];
[downloader startWithURL:url_3 saveWithFileName:@"MKTileOverlay_class" offline:YES];


}

Comments