iphone - UIImagePickerController iPad 问题

标签 iphone objective-c uiimagepickercontroller

我有以下代码:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] initWithRootViewController:self];
imagePicker.delegate = self;

popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[imagePicker release];
[popover presentPopoverFromRect:CGRectMake(100, 100.0, 0.0, 0.0) 
                         inView:self.view
       permittedArrowDirections:UIPopoverArrowDirectionAny 
                       animated:YES];

但这只会破坏 self.view 而不会显示任何内容。当我将 inView: 设置为 [self.view window] 时,选择器至少会出现。但它仍然删除了 self.view。我必须怎么做才能使 View 不消失?

最佳答案

您正在错误地初始化 UIImagePickerController。尝试将其更改为

[[UIImagePickerController alloc] init]

关于iphone - UIImagePickerController iPad 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3361632/

相关文章:

iphone - 加载了 nib 文件但未设置 View 导出

objective-c - Objective C - 数字数组

自定义键盘扩展中的 iOS8 UIImagePickerController

ios - 如何在捕获图像时在相机屏幕中添加任何自定义图像?

ios - Swift-XCode - 如何让文本字段具有用户可以选择的设置值?

ios - UINavigationBarDelegate shouldPop 项目奇怪的行为

objective-c - 用于 NSString 的四舍五入

ios 6上的iOS UIImagePickerController奇怪崩溃

iphone - 从不兼容的类型警告分配给

ios - PopViewController 占用内存