Reputation: 454
I have encountered a strange problem and would appreciate help and suggestions. I have a code base that I can compile and run successfully from Xcode 5.0.2 . Base sdk is iOS 7.0 . I can deploy the ipa created out of this code base from Xcode 5.0.2 in an iOS 8.0 device without an issue.However while fixing a issue I have written the following code :
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
self.view.transform = landscapeTransform;
}
This code runs as expected in iOS 8.3 but breaks in iOS 8.0.2 is there something obvious that I am missing?
Upvotes: 0
Views: 63
Reputation: 192
I have also done the rotation in one of the app. I have used below code.
__block UIImage *newImage = nil;
void (^rotateImage)(void) = ^{
UIView *rotatedViewBox = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.size.width, self.size.height)];
CGAffineTransform t = CGAffineTransformMakeRotation(radians);
rotatedViewBox.transform = t;
};
I have used Block statement. You can add your code there and try once. See if its crashing or not?
Upvotes: 1