-
Notifications
You must be signed in to change notification settings - Fork 122
issue5-4-from-NSURLConnection-to-NSURLSession 's issue. #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hm, I see what you mean. Probably the block needs to move the file there. @mattt, could you have a look at this? If not, I could also update it! |
Indeed, I had mixed that up with what AFNetworking does for download tasks. The code should be: NSURLSessionDownloadTask *downloadTask = [session downloadTaskWithRequest:request
completionHandler:
^(NSURL *location, NSURLResponse *response, NSError *error) {
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSURL *documentsDirectoryURL = [NSURL fileURLWithPath:documentsPath];
NSURL *documentURL = [documentsDirectoryURL URLByAppendingPathComponent:[response
suggestedFilename]];
[[NSFileManager defaultManager] moveItemAtURL:location
toURL:documentURL
error:nil];
}]; The updated paragraph should omit ", which is then the return value of the block".
|
o,o,soga |
in the paragraph "Download requests take a request as well...." of section
Constructors
in article issue-5-4 I found something hard to be understood.[response URL]
instead of the return valueNSURL * location
. isn't the latter to be the actual temp file's URL?The text was updated successfully, but these errors were encountered: