Hi all,
I am trying to download a relatively large file from within my app. However, whenever it doesn't work and when I look in the folder in the iPhone Simulator folder in my Library, all I see is a 4kB file, nothing close to the 10 or 15mB it should be. Here is the code I am using.
Code:
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:theURL]];
NSData *theData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];
NSArray *path = (NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES));
NSString *theDirectory = [path objectAtIndex:0];
NSString *theName = [NSString stringWithFormat:@"movie.mov"];
theDirectory = [theDirectory stringByAppendingPathComponent:movieName];
[theData writeToFile:theDirectory atomically:YES];
Any help would be appreciated. Thanks!