I strongly recommend you look up the UIViewController
class in docs and read it all (assuming you haven't already). The key methods you need include willRotateToInterfaceOrientation:duration:
, described as follows:
willRotateToInterfaceOrientation:duration:
Sent to the view controller just before the user interface begins rotating.
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
Parameters toInterfaceOrientation
The
new orientation for the user
interface. The possible values are
described in UIInterfaceOrientation.
duration
The duration of the pending
rotation, measured in seconds.
Discussion Subclasses may override
this method to perform additional
actions immediately prior to the
rotation. For example, you might use
this method to disable view
interactions, stop media playback, or
temporarily turn off expensive drawing
or live updates. You might also use it
to swap the current view for one that
reflects the new interface
orientation. When this method is
called, the interfaceOrientation
property still contains the view’s
original orientation.
This method is called regardless of
whether your code performs one-step or
two-step rotations.
Availability Available in iOS 2.0 and
later.
It sounds like you should also include:
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return NO;
}