How about a notification like this to detect the orientation change??
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
But, before that you need to register for generating notifications like this.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];