Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NKAssetDownload Download Issues
  2. // Download the Issue!
  3.     NSLog(@"Starting Download of issue %@",issue.name);
  4.  
  5.     // Generate the url of the issue        
  6.     NSURL * downloadURL = [dataManager pdfURLForIssue:issue];
  7.  
  8.     // Create the request
  9.     NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:downloadURL
  10.                                                            cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
  11.                                                        timeoutInterval:30.0];
  12.  
  13.     // Create the NKAssetDownload object
  14.     NKAssetDownload *assetDownload = [issue addAssetWithRequest:request];
  15.  
  16.     // Set user info so I know which issue's UIProgressView to update
  17.     [assetDownload setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:issue.name,@"Name",
  18.                                 nil]];
  19.  
  20.     // start download
  21.     [assetDownload downloadWithDelegate:self];