考虑以下方法,并注明其行为。
ItemContainerStyle
为什么这不起作用,我该如何解决?
答案 0 :(得分:0)
正如他们的名字所示,方法Style
和- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// Apparently valid URL, looks like
// "file:///private/var/mobile/Containers/Data/Application/.../filename.mov"
NSURL *videoURL = info[UIImagePickerControllerMediaURL];
// Always evaluates to false; no videos are saved
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(videoURL.absoluteString) {
UISaveVideoAtPathToSavedPhotosAlbum(videoURL.absoluteString, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
}
}
期望路径,而不是网址。 Not the same thing.
字符串
UIVideoAtPathIsCompatibleWithSavedPhotosAlbum()
是网址,由方案
组成 UISaveVideoAtPathToSavedPhotosAlbum()
和路径
file:///private/var/mobile/Containers/Data/Application/.../filename.mov
传递完整的URL时,用于接受路径的函数将无法正常工作。
要解决此问题,请将file://
的来电替换为/private/var/mobile/Containers/Data/Application/.../filename.mov
。