Nirmit Patel
Nirmit Patel

Reputation: 7

Copy 300MB Data From Server To iPhone

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 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.

Upvotes: 1

Views: 181

Answers (1)

Hassan Syed
Hassan Syed

Reputation: 20485

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.

Upvotes: 3

Related Questions