-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
-(BOOL)shouldAutorotate{
return YES;
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{//2.0-6.0
return YES;
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenOrientation) name:UIDeviceOrientationDidChangeNotification object:nil];