我们如何在用户退出应用程序后恢复下载,而不仅仅是进入后台?
我的代码最初看起来像这样开始下载,我希望能够在这里确定问题是否可以恢复。
NSMutableURLRequest *nkRequest = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:30.0];
NKLibrary *library = [NKLibrary sharedLibrary];
NKIssue *issue = [library addIssueWithName:[downloadInfo objectForKey:kPackageID] date:[NSDate date]];
[[NKLibrary sharedLibrary] setCurrentlyReadingIssue:[[NKLibrary sharedLibrary] issueWithName:[downloadInfo objectForKey:kPackageID]]];
NKAssetDownload *asset = [issue addAssetWithRequest:nkRequest];
[asset setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:info,@"info", nil]];
[asset downloadWithDelegate:self];