For the curious question?


#1

I’m trying to implement the steps taken from this chapter on a test app I am working on.

I wanted to record a video file from the device, have it saved to the camera roll, and then delete it from the temp directory. I followed the steps in the for curious section but the file would never save to my camera roll unless I left out this line of code.

So now my code in the imagecontrollerpicker looks like this - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSURL *mediaURL = [info objectForKey:UIImagePickerControllerMediaURL]; if (mediaURL){ if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum([mediaURL path])){ //Save the video to the photos album UISaveVideoAtPathToSavedPhotosAlbum([mediaURL path], nil, nil, nil); } } [self dismissViewControllerAnimated:YES completion:nil]; }

I am not going to be loading the saved video at all in the app just needed it to saved to the photo library but I do know it isn’t a good idea to leave big files in the temp directory so wanted to get rid of it, but only if my video was able to saved to the camera roll.

Also if I wanted to upload the video file to a server as soon as I hit use on the imagepickercontroller how would I do that?