Вам придется реализовать, чтобы стать делегатом объекта UIImagePickerController
, и реализовать imagePickerController:didFinishPickingMediaWithInfo:
следующим образом -
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// This is the URL where the movie is stored (in the tmp directory)
NSURL *movieURL = [info objectForKey:UIImagePickerControllerMediaURL];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"movie.mov"]; // You will have to vary this.
NSURL *fileURL = [NSURL URLWithString:filePath];
NSError *error;
if ( [[NSFileManager defaultManager] moveItemAtURL:movieURL toURL:fileURL error:&error] ) {
NSLog(@"Error copying: %@", [error localizedDescription]);
}
[self dismissModalViewControllerAnimated:YES];
}