开发者

UIImagePickerController crashes on iOS4

开发者 https://www.devze.com 2023-01-18 03:28 出处:网络
When trying to show the UIImagePickerController I had strange problems with my app crashing on iOS4. Here\'s the output from log:

When trying to show the UIImagePickerController I had strange problems with my app crashing on 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. 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.


Is cameraPicker a property? 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);

0

精彩评论

暂无评论...
验证码 换一张
取 消