You need to watch for the orientation to change via the NSNotificationCenter then handle it.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(orientationChanged:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
Then create the method to handle the rotation
- (void)orientationChanged:(NSNotification *)notification
{
// Get device orientation
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (UIDeviceOrientationIsPortrait(deviceOrientation))
{
// Portrait
}
else if(UIDeviceOrientationIsLandscape(deviceOrientation))
{
// Landscape
}
}