Нежелательная двойная панель навигации

Я сделал так, чтобы навигационная панель (верхняя панель) появлялась / исчезала при касании экрана, а также лежала поверх фонового изображения. Это работало, но с одной проблемой: у меня внезапно появилось две панели навигации! Сначала нажмите кнопку «Назад», а когда я нажму «Назад», нажмите кнопку «Назад». она открывает новую панель навигации с кнопкой «Vinene», которая является названием TableView, к которому она ведет. Это тот, который я хочу сохранить. Я думаю, что проблема где-то в DetailViewController.m или в didselectrowatindexpath в MasterViewController.m. Надеюсь, кто-то может увидеть проблему!

DetailViewController.m:

@interface WinesDetailViewController ()

@end

@implementation WinesDetailViewController

@synthesize wineDictionary;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    // Custom initialization
}
return self;
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.

self.navigationController.navigationBar.translucent = YES;
                         self.wantsFullScreenLayout = YES;

UITapGestureRecognizer *tap = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideShowNavigation)] autorelease];
                                                                                                         tap.numberOfTapsRequired = 1;
                                                                                                 [self.view addGestureRecognizer:tap];
}

- (void) hideShowNavigation
{
[self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden];
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (BOOL)hidesBottomBarWhenPushed{
return TRUE;
}


@end

MasterViewController.m:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];    

    NSDictionary *dictionary = [wine libraryItemAtIndex:indexPath.row];

    if (winesDetailViewController == nil) {
        // Init the wine detail view
        winesDetailViewController = [[WinesDetailViewController alloc] init];
    }
    // Here you pass the dictionary
    winesDetailViewController.wineDictionary = dictionary;

    [self.navigationController pushViewController:winesDetailViewController animated:YES];
    }
}

Ответы на вопрос(1)

Ваш ответ на вопрос