It seems that when my app loads, it does not know its current orientation:
UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
if (o
I still use this working code snippet for iphone 4:
-(void)deviceOrientationDidChange:(NSNotification *)notification{
//Obtaining the current device orientation
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
int value = 0;
if(orientation == UIDeviceOrientationPortrait)
{
value = 0;
}else if(orientation == UIDeviceOrientationLandscapeLeft)
{
value = 90;
}else if(orientation == UIDeviceOrientationLandscapeRight)
{
value = -90;
}
CGAffineTransform cgCTM = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(value));
[photoImageView setTransform:cgCTM];
}