小编Jos*_*800的帖子

5
推荐指数
1
解决办法
6899
查看次数

如何使用UIPopOverController制作在iPhone上使用ImagePicker工作的iPhone应用程序?

我正在制作一个通用的应用程序,它在iPhone上运行良好!但是在iPad上,它无法拉动图像选择器.代码是:

- (IBAction)openImagePicker:(id)sender //Makes UIImagePicker roll up from the bottom.
{
    UIActionSheet *alertSheet = [[UIActionSheet alloc] initWithTitle:@"Where do you want to get your daily image?" delegate:(self) cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Camera", @"Library", nil];
    [alertSheet setTag:0];
    [alertSheet setDelegate:self];
    [alertSheet showFromTabBar:[[self tabBarController] tabBar]];
    [alertSheet release];
}
Run Code Online (Sandbox Code Playgroud)

它说的原因是" *由于未捕获的异常'终止应用'NSInvalidArgumentException',原因:'在iPad上,UIImagePickerController必须通过UIPopoverController呈现'"我该怎么做?谢谢您的帮助.

cocoa-touch objective-c ipad uipopovercontroller ios

2
推荐指数
1
解决办法
7709
查看次数