Hi,
I was going through the various interface orientation explanations, and I guess this is the condensed way of doing it:
In the ApplicationDelegate do this:
- (BOOL)shouldAutorotateToInterfaceOrientation: UIInterfaceOrientation)interfaceOrientation{ return YES; }
In the SPStage class, in it's initWithWidth: Height: method add this:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationDetected:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
and add another method in this class:
-(void) orientationDetected:(UIEvent *)event{ NSLog(@"%i",[UIDevice currentDevice].orientation); }
Whenever the device is now turned, the orientationDetection method gets called, and you can update the screen accordingly within this method.
I know there are several posts about this already, but I think the above one is the most straight forward way of doing it, and it is as straight forward as possible.
Cheers Arend