views:

476

answers:

0

Hi guys

i have a iphone sdk orientation issue...

i push a "holding" view controller onto the navigationController. The holdingViewController uses viewDidLoad to show the navigationController navbar and add a flip button to it and a selector for the flipbutton. it then adds a subview using UIViewAnimationTransitionNone showing a UIView containing a TableView. When the flip button is clicked the holding view controller removes the loaded subview and replaces with the another subview, also containing a view with a tableview, and transforms using the flip animation. The problem comes when flipping and changing orientations. although both flipping and rotating appear to work at first if i flip while in landscape mode, the flipped view is sort of "cropped" to portrait width, although actually displayed in landscape, rotation then doesnt fix it, u have to flip back, rotate back to portrait, then flip back again. It looks like the holdingview is not registering the change in orientation, but i know it is as i've implemented

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];

on all 3 view controllers and i can see orientationChanged function being called for each.

All three viewcontrollers are setting autoresizing in viewDidLoad

self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 

and i've also implemented

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
 return YES;
}

does anybody have any ideas whats going on, or more importantly, what i can do to fix it?

many thanks