Remove temporary captured video produced by UIImagePickerController -
i use following codes capture video in uiimagepickerviewcontroller
:
- (ibaction)openvideopicker:(id)sender { self.video_picker = [[uiimagepickercontroller alloc] init]; self.video_picker.delegate = self; self.video_picker.allowsediting = yes; if ([uiimagepickercontroller issourcetypeavailable:uiimagepickercontrollersourcetypecamera]) { self.video_picker.sourcetype = uiimagepickercontrollersourcetypecamera; self.video_picker.mediatypes = [nsarray arraywithobjects:(nsstring *)kuttypemovie, nil]; } else { self.video_picker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; } [self presentviewcontroller:self.video_picker animated:yes completion:nil]; }
when browse files in sand box, there lot of videos capture in /myapp/tmp/capture
folder. since occupy quite lot amount of file size. when these temp files removed ? or can remove them manually via programming?
based on this comment can programmatically:
nsstring *videopath = @""; // path video nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if ([filemanager fileexistsatpath: videopath]) { nserror *error; // attempt delete folder containing videopath if ([filemanager removeitematpath: [videopath stringbydeletinglastpathcomponent] error: &error] != yes) { nslog(@"unable delete file: %@", [error localizeddescription]); } }
Comments
Post a Comment