views:

133

answers:

2

Hi,

I would like to display a different controller when the iPhone is rotated. But only on it is on a certain controller. This is very similar to what the Bloomberg app does when you are looking at a stock. Turn the device and a 3 month's chart shows up.

If there are some examples of this posted, that would be great to look at. If someone could post where they are.

thx, wes

+1  A: 

I'd first read through Apple's documentation on how to handle orientation changes. It's relatively straight forward - in your view which responds to the orientation changes, you'll want to implement -shouldAutorotateToInterfaceOrientation: and some combination of -willRotateToInterfaceOrientation:duration: and -didRotateToInterfaceOrientation:duration:.

If you want separate view controllers for each orientation, I would use a "parent" view controller that responds to orientation changes and contains the logic to switch out views and view controllers based on its orientation.

pix0r
+2  A: 

Here's Apple's AlternateViews sample project that does exactly what you're talking about.

Frank Schmitt
Tried this answer and got it working.thx.
Wes