After several tries, I found the next to work the best :

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

if((toInterfaceOrientation == UIDeviceOrientationLandscapeLeft) || (toInterfaceOrientation == UIDeviceOrientationLandscapeRight)) {
NSLog(@”didRotateFromInterfaceOrientation Landscape”);
isPortrait = NO; //Global variable
}
else {
NSLog(@”didRotateFromInterfaceOrientation Potrait”);
isPortrait = YES;
}

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 W2OM - iPhone by code Suffusion theme by Sayontan Sinha