0
如何在用户退出应用程序后恢复下载,而不仅仅是放入后台?应用程序在用户关闭后报亭恢复下载完全
我的代码看起来像这样开始下载最初,我想能够在这里确定问题是否可以恢复。
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];