thefaj/OpenFlow

iOS 4.2.1 on iPhone 3G

mhausherr opened this issue · 6 comments

I've a bug on iPhone 3G (ot 3Gs or 4) with the iOS 4.2.1 with the setFrame method of AFItemView.m
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [6.19918e-06 nan]'

I fixe it by adding a test

  • (void)setFrame:(CGRect)newFrame {
    CGSize size = newFrame.size;
    if(isnan(size.height)||isnan(size.width)){
    newFrame = CGRectMake(newFrame.origin.x, newFrame.origin.y, 0, 0);
    }
    [super setFrame:newFrame];
    [imageView setFrame:newFrame];
    }

I don't understand the real cause of this issue but it works, so i don't commit this code now. Tell me if you want.

Hope it's help.

Great fix!

excellent!!!!
this was driving me crazy...
thanx!!!!

I had the same issue. THX for fixing it! Does anyone know the reason for this issue?

It's wonderful!!!
THX mhausherr!!!

Thank you so much, mhausherr. For some reason I did not run into this issue when building and running on the device with Xcode. I only encountered it when I was doing an Ad Hoc distribution of my app (using Build and Archive) and running from an ipa file. Sounds like its an iOS 4.2 issue.

Thanks, mhausherr.