I am pretty sure what I am seeing is how this is supposed to work, but I as just curious as to why. When I rotate the iPhone in the simulator the method (see below) that allows the orientation gets called twice with each single rotation. Is there a reason for this?
-(BOOL)shouldAutorotateToInterfaceOrientation:interfaceOrientation
EDIT_001
This is what gets called when the iPhone detects a rotation, I am just curious that each time I do a rotate in the simulator the NSLog statements print twice (i.e. the method is getting called twice)
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
BOOL autoRotate = NO;
switch(interfaceOrientation) {
case UIInterfaceOrientationPortrait:
NSLog(@"Orientation(%d): Portrait Supported", interfaceOrientation);
autoRotate = YES;
break;
case UIInterfaceOrientationPortraitUpsideDown:
NSLog(@"Orientation(%d): UpsideDown unsupported", interfaceOrientation);
autoRotate = NO;
break;
case UIInterfaceOrientationLandscapeLeft:
NSLog(@"Device: RIGHT, Interface: LEFT(%d)", interfaceOrientation);
autoRotate = YES;
break;
case UIInterfaceOrientationLandscapeRight:
NSLog(@"Device: LEFT, Interface: RIGHT(%d)", interfaceOrientation);
autoRotate = YES;
break;
}
return(autoRotate);
}
gary