I have an iPhone app developed on Xcode 4. It works correctly in the following environments:
- iPhone Simulator (iOS 5 version)
- IOS 5 device (running from archive)
- IOS 5 device (running from an Xcode build)
- IOS 4 device (running from an Xcode build)
- IOS 3 device (made from the Xcode assembly)
However, when I put an archive that works in iOS 5 on an iOS 3 or 4 device, it acts funny. The exact same code works fine when launched from Xcode on the same device.
When I say that it acts funny, it animates the sliding UIView on the wrong axis. I am actually doing a rotation conversion on a UIView before I animate it. But then again, it works great when launched directly from Xcode, even on iOS 3 and 4. It only works in the archive and only for iOS 3 and 4. The archive works fine in iOS 5.
The rotation is performed by a static call in the helper class:
+ (UIImage*)rotateImage:(UIImage *)image { CGRect bnds = CGRectZero; UIImage* copy = nil; CGContextRef ctxt = nil; CGImageRef imag = image.CGImage; CGRect rect = CGRectZero; CGAffineTransform tran = CGAffineTransformIdentity; rect.size.width = CGImageGetWidth(imag); rect.size.height = CGImageGetHeight(imag); bnds = rect; bnds = swapWidthAndHeight(bnds); tran = CGAffineTransformMakeTranslation(rect.size.height, 0.0); tran = CGAffineTransformRotate(tran, M_PI / 2.0); UIGraphicsBeginImageContext(bnds.size); ctxt = UIGraphicsGetCurrentContext(); CGContextScaleCTM(ctxt, -1.0, 1.0); CGContextTranslateCTM(ctxt, -rect.size.height, 0.0); CGContextConcatCTM(ctxt, tran); CGContextDrawImage(UIGraphicsGetCurrentContext(), rect, imag); copy = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return copy; }
Animation is performed using:
Everything else is working fine. Any thoughts?
source share