我的带有相机的 UIImagePickerController 很奇怪
我在 iPhone 上通过划痕使用相机时遇到问题。其他人的代码在我的 3GS 上运行良好,但我的代码却不能。
当我实现 UIViewController
控制器时,我在 viewdidload
中添加以下代码:
UIImagePickerController *picker = [UIImagePickerController alloc] init];
picker.source = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self; //Previously added all the delegate properly
[self presentModalViewController:picker animated:YES];
什么也没有出现。 我检查了调试器,它显示选择器已分配,但这是我的和成功的之间的主要区别。
picker._imagepickerflag.visible = 0; //others show 1;
picker.UINavigationController._containerView: 0x0 ; // others have value.
谁能帮我解决这个问题,有什么问题吗?
谢谢。
I met a problem on using camera by scratch on iphone. Other people's code just run fine on my 3GS, but my code doesn't.
When I implemented a UIViewController
controller, and I add the following code in viewdidload
:
UIImagePickerController *picker = [UIImagePickerController alloc] init];
picker.source = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self; //Previously added all the delegate properly
[self presentModalViewController:picker animated:YES];
Nothing comes out.
I checked in the debugger, it shows that the picker is allocated, but here is the major difference between my and success one.
picker._imagepickerflag.visible = 0; //others show 1;
picker.UINavigationController._containerView: 0x0 ; // others have value.
Can anyone help me on this, is there something wrong?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上面的代码是错误的。应该是
下面这个也是错误的。
它应该是
并且一旦它被呈现你就应该释放它。
希望有帮助。
Above code is wrong. It should be
This below is also wrong.
it should be
And you should release it once it has been presented.
Hope that helps.