tags:

views:

59

answers:

1

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.

+3  A: 

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.

Hassan Syed
it is right now 300 MB but it can goes to 500 MB that's why i mention 500 MB
Nirmit Patel