[英]UIImagePickerController crash on iOS 5
UIImagePickerController *ii_picker= [[UIImagePickerController alloc] init];
ii_picker.delegate=self;
ii_picker.sourceType=UIImagePickerControllerSourceTypeCamera;
add_photo=NO;
[self presentModalViewController:ii_picker animated:YES];
[ii_picker release];
This used to work fine till I updated to iOS 5 on my iPhone. 直到我在iPhone上更新到iOS 5之前,它都可以正常工作。 Something strange... 奇怪的东西...
Problem isn't in the code. 问题不在代码中。 It's working in blank project! 它在空白项目中工作! If I paste it to any place in my project's code, it's crashing. 如果将其粘贴到项目代码中的任何位置,则会崩溃。 If I change UIImagePickerControllerSourceTypeCamera
to UIImagePickerControllerSourceTypeSavedPhotosAlbum
, it's working in iOS5. 如果我将UIImagePickerControllerSourceTypeCamera
更改为UIImagePickerControllerSourceTypeSavedPhotosAlbum
,那么它将在iOS5中运行。
Does anybody know where the problem is? 有人知道问题出在哪里吗?
If app is crashes in iOS 5 , then try to use 如果应用程序在iOS 5中崩溃,请尝试使用
[self dismissModalViewControllerAnimated:YES];
picker = nil ;
In place of [[picker parentViewController] dismissModalViewControllerAnimated:YES]; [picker release];
代替[[picker parentViewController] dismissModalViewControllerAnimated:YES]; [picker release];
[[picker parentViewController] dismissModalViewControllerAnimated:YES]; [picker release];
If your app crashes as below, need to change the app's product name in English. 如果您的应用程序崩溃如下,则需要以英语更改应用程序的产品名称。
In my case product name was written in Korean, this led to the crash in ios5 when UIImagePickerController's source type is UIImagePickerControllerSourceTypeCamera. 在我的情况下,产品名称是用韩语编写的,这导致当UIImagePickerController的源类型为UIImagePickerControllerSourceTypeCamera时,导致ios5崩溃。
请注意,在模拟器上没有摄像头,因此可能会导致这种情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.