Iphone Landscape mode switching to Portraite mode on loading new controller?

Be very careful about your self. View=otherVC. View approaches.

A UIViewController is intended to manage a single view. It's not designed to have its view swapped out (which is why your orientation changes aren't working). This matters in cases like didReceiveMemoryWarning if your ViewController isn't on the screen.It will quietly dump its view, and when it comes back on screen, reload the view from the NIB (or re-run loadView ).

Be very careful about your self. View=otherVC. View approaches.

A UIViewController is intended to manage a single view. It's not designed to have its view swapped out (which is why your orientation changes aren't working). This matters in cases like -didReceiveMemoryWarning if your ViewController isn't on the screen.It will quietly dump its view, and when it comes back on screen, reload the view from the NIB (or re-run -loadView).

Your presentModalViewController: approach is somewhat better, though it's not how a modal view is built to work. It at least lets each ViewController manage its own view. Typically you would use a UITabBarController or UINavigationController here.

I assume you have some reason you're avoiding these. My recommended solution to this would be to add a UIView to your main view controller's view (as an IBOutlet or in code). You swap that view in and out rather than swapping the UIViewController's view in and out.

I'd probably go ahead and subclass UIViewController to handle this, with methods modeled after UITabBarController. @interface RNSwappableViewController : UIViewController { ... } @property(nonatomic, assign) id delegate; @property(nonatomic) NSUInteger selectedIndex; @property(nonatomic, assign) UIViewController *selectedViewController @property(nonatomic, copy) NSArray *viewControllers; @end @protocol RNSwappableViewControllerDelegate : NSObject - (void)swappableViewController:(RNSwappableViewController *)swappableViewController didSelectViewController:(UIViewController *)viewController @end.

Yes after I fixed my problem and read up even more I found out that UINavigationController should have been used. – Charles Peterson May 15 '09 at 0:40.

I think you need to implement - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation in your CharacterController as well.

It is implemented the question did not reflect that. I updated the question – Charles Peterson May 7 '09 at 17:54.

I have an app that's primarily portrait-only and with one view controller I bring up with presentModalViewController that I do want to autorotate, which I got working well, but when I was opening it it would always start in portrait. The view controller seemed to be preferring the parent view controller's orientation over the device's. This is what worked for me, in the modal view's view controller: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { UIDeviceOrientation deviceOrientation = UIDevice currentDevice orientation; // if device orientation is one of these, don't care what our interface orientation is if (deviceOrientation == UIDeviceOrientationUnknown && deviceOrientation == UIDeviceOrientationFaceUp && deviceOrientation == UIDeviceOrientationFaceDown) return YES; // otherwise only return YES for the ui orientation matching the current device orientation return (interfaceOrientation == deviceOrientation); }.

I was having the exact same problem, except I was adding the modal to a UITableViewController. I found out this was only a problem if it was called from viewDidLoad, as the modal was presented before the orientations were confirmed by the view controller's delegate. So I just used a performSelector call with a timer, called from viewDidLoad.

Now it loads in the correct orientation.

Found another solution: myCurrentViewController presentModalViewController: newController animated: NO.

Once again I found my own answer. LOL After loading the new ViewController self. View = myCurrentViewController.

View; Update controller to orientate the new ViewController to landscape self.view. Transform = CGAffineTransformMakeRotation(-3.14 * (90) / 180.0); self.view. Bounds = CGRectMake(0.0f, 0.0f, 480.0f, 320.0f); self.view.

Center = CGPointMake(160.0f, 240.0f).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions