UIImagePickerController在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]; 

这一直很好,直到我在iPhone上更新到iOS 5。有点奇怪...

This used to work fine till I updated to iOS 5 on my iPhone. Something strange...

问题不在代码中。它在空白项目中工作!如果我将它粘贴到项目代码中的任何位置,它就会崩溃。如果我将 UIImagePickerControllerSourceTypeCamera 更改为 UIImagePickerControllerSourceTypeSavedPhotosAlbum ,它可以在iOS5中使用。

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.

有人知道问题所在吗?

如果你的应用程序崩溃如下,需要更改应用程序的产品名称用英语。

If your app crashes as below, need to change the app's product name in English.

在我的案例中,产品名称是用韩语编写的,当UIImagePickerController的源类型为UIImagePickerControllerSourceTypeCamera时,这导致ios5崩溃。

In my case product name was written in Korean, this led to the crash in ios5 when UIImagePickerController's source type is UIImagePickerControllerSourceTypeCamera.