You can declare a BOOL variable in the shouldAutoRotate method and set it when it is called, and then in the selection method to display and hide the subtitle, you can use a simple condition when the weather window rotates or not.
like this:
if(viewRotated) { subView.hidden = YES; } viewRotated = NO;
Change part:
I'm not sure what is going on in this code, but it works fine in one of my applications, the ipad encoding of which was done by my friend.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if(UIInterfaceOrientationIsPortrait(interfaceOrientation)) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillShowNotification object:nil]; } else { [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; } return YES; }
And you can add a notification again if your UIKeyboardWillHideNotification is not running by adding this notification again to this method.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
source share