Selective autorotation in a UINavigationController
First of all you could skip storing the current view controller in a variable. And instead of checking for the correct class you could delegate your shouldAutorotateToInterfaceOrientation: to the current visible one in the navigation controller.

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // assumes you've got access to the navigation controller here
    UIViewController *visibleController = navigationController.visibleViewController;

    return [visibleController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}