开发者

Copy 300MB Data From Server To iPhone

开发者 https://www.devze.com 2022-12-19 21:53 出处:网络
i want to copy large data ie... around 1400 files around 500 MB from web server to iphone documents directory. it is taking more than hour .some how i want to开发者_如何学JAVA reduce the time taken fo

i want to copy large data ie... around 1400 files around 500 MB from web server to iphone documents directory. it is taking more than hour .some how i want to开发者_如何学JAVA reduce the time taken for coping file.

i m using code:

NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:someURL]];

if([data writeToFile:self.documentsDirectory atomically:YES])
    NSLog(@"File Copied");

i m using above code in for loop till no of file ends. can some one suggest a better way??? i had tried NSOperationQueue and CFFTPURL but doesnot improve performance significantly.


Are you doing this on wifi ? either way turn the data into an archive using tar/zip etc... before transport. It is a known fact that sending multiple files over a network is orders of magnitudes slower than concatenating the objects first.

0

精彩评论

暂无评论...
验证码 换一张
取 消