You would do something like this:
- (void) downloadVideo
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.xyz.com/image.mp4"]];
NSString *tempPath = [NSString stringWithFormat:@"%@/%@", NSTemporaryDirectory(), temp.mp4];
[imageData writeToFile:tempPath atomically:NO];
UISaveVideoAtPathToSavedPhotosAlbum (@ tempPath, self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
);
- (void) video: (NSString *) videoPath
didFinishSavingWithError: (NSError *) error
contextInfo: (void *) contextInfo {
NSLog(@"Finished saving video with error: %@", error);
}
There are two things to consider:
- Make sure you provide the URL scheme. This is not a browser, it is not going to try to autocomplete http and guess about you.
- ,
dataWithContentsOfURL:. 20 , , . , , , NSURLConnection.