
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.90 KB | hits: 41 | expires: Never
NKAssetDownload Download Issues
// Download the Issue!
NSLog(@"Starting Download of issue %@",issue.name);
// Generate the url of the issue
NSURL * downloadURL = [dataManager pdfURLForIssue:issue];
// Create the request
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:downloadURL
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:30.0];
// Create the NKAssetDownload object
NKAssetDownload *assetDownload = [issue addAssetWithRequest:request];
// Set user info so I know which issue's UIProgressView to update
[assetDownload setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:issue.name,@"Name",
nil]];
// start download
[assetDownload downloadWithDelegate:self];