【发布时间】:2014-08-26 03:17:22
【问题描述】:
编辑:我刚刚发现问题是 UIImagePicker 而不是视频编辑器更改代码来表示它。
我正在努力做到这一点,所以当他们点击 UIImagepicker 上的取消按钮时,它会关闭它并退出 Facebook 并转到主视图。
这是我必须忽略的。
-(IBAction)Logout:(id)sender
{
[[FBSession activeSession]closeAndClearTokenInformation ];
[self.parentViewController dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:(YES)];
}
这是我展示图像选择器的方式
//Create an image picker
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
//Get the videos from the photo library
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//Set media types to movie tyeps
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *) kUTTypeMovie, nil];
//present the controller
[self presentViewController:imagePicker animated:YES completion:nil];
我得到的错误是由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'* -[NSURL initFileURLWithPath:isDirectory:]: nil string parameter'
我什至没有在我的程序中的任何地方使用 initFileURLWithPath,所以我不知道现在的问题是什么。我已经缩小范围,认为解雇导致错误发生,我不确定现在出了什么问题。谢谢。
【问题讨论】:
-
我设法解决了这个问题。错误的代码不是发布的代码的一部分。基本上我试图将一个 url(那是 nil)分配给另一个 url,这就是导致错误的原因。错误消息仍然有点模棱两可。
标签: ios objective-c