Bug on submitted app binary but not in the simulator - CALayer position contains NaN

Posted by Jonathan Thurft on Stack Overflow See other posts from Stack Overflow or by Jonathan Thurft
Published on 2013-11-11T09:29:46Z Indexed on 2013/11/11 9:54 UTC
Read the original article Hit count: 140

Filed under:
|
|

I submitted my app to the App Store where is ready to download. I've since then received some interesting crash reports when people select an image from the ImagePicker in one of my views.

This bug (see below) makes the app crash. I was wondering 2 things.

  1. Can anyone spot the problem in the code below?

  2. How do you deal with bugs that are only in the App Binary but do not show up when trying to recreate them on the dev environment? - I can make the app crash with the Binary that is on the app store but when I do the same on the simulator or on my test phone the app works perfectly..

The Crash report in BugSense

CALayer position contains NaN: [798 nan]
Class:

CALayerInvalidGeometry
 0x00120e99 -[imageCroppingViewController imagePickerController:didFinishPickingMediaWithInfo:] (imageCroppingViewController.m:126) + 163481

The Code

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];

    imageView.image = image;
    CGRect rect;
    rect.size.width = image.size.width;
    rect.size.height = image.size.height;
    imageView.center = scrollView.center;
    [imageView setFrame:rect];

    scrollView.contentSize = imageView.frame.size;
    self.navigationController.navigationBar.hidden = NO;
    [myPicker.view removeFromSuperview];
}

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa-touch