I am trying to make an app where each view controller (.h/.m) has 2 NIB files... one for portrait, one for landscape. Is this the "standard" way of supporting orientation or must I manually set up the orientation view programmatically? The problem I am facing is that when a user flips the orientation, all views are reset (so the user must re-enter text fields/views input).
Here is my orientation method:
- (void) changeTheViewToPortrait:(BOOL)portrait andDuration:(NSTimeInterval)duration{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
if(portrait) {
[[NSBundle mainBundle] loadNibNamed:@"myview-portrait" owner:self options:nil];
[self setupLayout];
} else{
[[NSBundle mainBundle] loadNibNamed:@"myview-landscape" owner:self options:nil];
[self setupLayout];
}
[UIView commitAnimations];
}