[英]UIImagePickerController crashes on iOS4
When trying to show the UIImagePickerController I had strange problems with my app crashing on iOS4. 当尝试显示UIImagePickerController时,我的应用在iOS4上崩溃时遇到了奇怪的问题。 Here's the output from log: 这是日志的输出:
malloc: *** error for object 0x550ba20: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Setting breakpoints, trying to spy the name of the object 0x550ba20 (with print-object) does not work. 设置断点,尝试监视对象0x550ba20的名称(带有打印对象)不起作用。 Enabling zombie detection also does not work. 启用僵尸检测也不起作用。 Here is my code: 这是我的代码:
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
cameraPicker = [[UIImagePickerController alloc] init];
cameraPicker.delegate = self;
cameraPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
// Insert the overlay:
cameraPicker.cameraOverlayView = self.overlay;
self.cameraPicker.delegate = self;
//Hide controls
cameraPicker.showsCameraControls = NO;
cameraPicker.navigationBarHidden = YES;
// Make camera view full screen:
cameraPicker.wantsFullScreenLayout = YES;
cameraPicker.cameraViewTransform = CGAffineTransformScale(self.cameraPicker.cameraViewTransform, 1.0, 1.12412);
[self presentModalViewController:cameraPicker animated:NO];
[cameraPicker release];
Any ideas? 有任何想法吗? Code is executed at the very end of viewDidLoad. 代码在viewDidLoad的最后执行。
Is cameraPicker a property? cameraPicker是属性吗? You are initializing it first as a local variable and then using it as a property: 首先将其初始化为局部变量,然后将其用作属性:
cameraPicker.cameraOverlayView = self.overlay;
!!self.!!cameraPicker.delegate = self;
and 和
cameraPicker.cameraViewTransform = CGAffineTransformScale(!!self.!!cameraPicker.cameraViewTransform, 1.0, 1.12412);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.