Solution for change orientation with uitabbar and others exeptions.

  1. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  2.         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didOrientation:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];

And method

  1. - (void) didOrientation: (id)object {
  2.    
  3.     UIInterfaceOrientation interfaceOrientation = [[object object] orientation];
  4.  
  5.     if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
  6.    
  7.         self.view.transform = CGAffineTransformMakeRotation(0);
  8.     } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight ){
  9.    
  10.         self.view.transform = CGAffineTransformMakeRotation(M_PI * .5);
  11.     } else {
  12.         self.view.transform = CGAffineTransformMakeRotation(M_PI * -.5);
  13.     }
  14. }