Reputation: 57
I have a zip file which contains db. i need to download that zip file when the user open the app at first time.So am using
NSData *urlData =[NSData dataWithContentsOfURL:urlToRequest];
to download a file in GCD mode. Since it's working fine,am not getting any errors.
But, is it ok to download a large File using the above method or we have to use NSURLConnection
for large file download. Please advice.
Upvotes: 3
Views: 4486
Reputation: 2598
You should use NSURLSession => NSURLSessionDownloadTask api
What is wrong with below for large file download
[NSData dataWithContentsOfURL:urlToRequest];
Now, NSURLSession => NSURLSessionDownloadTask supports all of the above.
Follow this nice tutorial:
Upvotes: 5