@Shan - I used your code to rotate the status bar and added a call to the following method to rotate the view. It Works!!!! So you got me half way there. Here is the rest of the code:
#define ROTATE_90 M_PI_2
#define ROTATE_180 M_PI
#define ROTATE_270 M_PI + M_PI_2
/**
* Rotates and resizes the view
*/
- (void)rotateToSelectedOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
CGRect viewRect = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
switch (toInterfaceOrientation) {
case UIInterfaceOrientationLandscapeLeft:
self.view.transform = CGAffineTransformMakeRotation(ROTATE_270);
break;
case UIInterfaceOrientationLandscapeRight:
self.view.transform = CGAffineTransformMakeRotation(ROTATE_90);
break;
case UIInterfaceOrientationPortrait:
self.view.transform = CGAffineTransformMakeRotation(0);
break;
case UIInterfaceOrientationPortraitUpsideDown:
break;
default:
self.view.transform = CGAffineTransformMakeRotation(0.0);
break;
}
if (UIInterfaceOrientationIsLandscape(self.currentOrientation) && UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
viewRect = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height);
} else {
viewRect = CGRectMake(0,0,self.view.frame.size.height,self.view.frame.size.width);
}
self.view.frame = viewRect;
self.currentOrientation = toInterfaceOrientation;
}