0
  • 我有一个名为“firstView”的简单视图(在 ViewDidLoad 方法中使用此代码:),它只[self setTitle:@"firstView"包含一个按钮。当我单击此按钮时,我的应用程序会显示另一个视图(称为“secondView”),这要归功于以下代码:

    - (IBAction)btnShowAnOtherView:(id)sender
    {
        secondView *secondView = [[secondView alloc] initWithNibName:@"secondView" bundle:nil];
        [self.navigationController pushViewController:secondView animated:YES];
    }
    

    然后,新视图(即“secondView”)自动将导航栏后退按钮标题设置为“firstView”所以一切正常

  • 我有一个名为“thirdView”的简单视图(在 ViewDidLoad 方法中使用此代码:)[self setTitle:@"thirdView",其中包含一个 UITableView。当我单击一个单元格时,我的应用程序会显示另一个视图(称为 “fourthView”),这要归功于以下代码:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
       fourthView *fourthView = [[fourthView alloc] initWithNibName:@"fourthView" bundle:nil];
       [self.navigationController pushViewController:fourthView animated:YES];
       [tableView deselectRowAtIndexPath:indexPath animated:YES];
    }
    

    但是新视图(即"fourthView")的导航栏后退按钮标题设置为"Back",而不是"thirdView"为什么 ?

这是第三个视图:http: //imageshack.us/a/img818/8886/ldp9.png

这是第四个视图:http: //imageshack.us/a/img33/2444/5y0k.png

谢谢你的帮助...

4

1 回答 1

0

当您没有设置 thirdview 标题时,会发生这种情况。但是您正在按照答案中的描述设置标题。检查您的第三个视图的标题是否显示在您的导航栏上?

于 2013-10-09T10:35:30.670 回答