I did look for possible answers but found none. my problem is that I only want one of the views in my app (which shows an image) to be in both portrait and landscape mode, while other views in portrait only.
this view is added to [[[UIApplication sharedApplication] delegate] window] as its subview.
and i set return YES in - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
and also [self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; in - (void)viewDidLoad
but when i turn the device the view doesn’t rotate. please tell me where i did wrong or what more needs to be done.
As far as I know, a subview (such as the one you added) is only sent the message saying the device has rotated if the owning container view passes it along. If you use a UINavigationController or UITabBar and add your view to that it is done for you, but if you add the view directly to the window as you have it isn’t.
EDIT: you can capture the device orientation changing yourself using UIDeviceOrientationDidChangeNotification with NSNotificationCenter.