Question

I push a new view with this:

- (IBAction)selectName:(id)sender {
     SelectNameViewController *nameController = [[SelectNameViewController alloc]
                                              initWithNibName:@"SelectNameView"
                                              bundle:nil];
    [self.navigationController pushViewController:nameController animated:YES];
    [nameController release];
}

But in the navigationbar of the new view, there isn't the back button.

Why this? I know I can create a custom back button, but I want the default, how can I fix it?

Thanks

Was it helpful?

Solution

I've solved. The problem was the NavigationController in the MainWindow.xib. I've created another NavigationController and it works.

OTHER TIPS

I think the problem is in your nib. Unfortunately I am not using Interface Builder therefore I have no idea what the problem could be.

I also had this problem today. For me, the reason was the following:

Normally, the title of the back button is the title of the previous navigation item. When the navigation item title is empty, the button title will be just "back". However, I added a localisation for all elements, including the navigation title. But I used an image instead of the title, so the localisation string was empty. In that special case, the back bar button will disappear completely.

Hope this helps someone someday, took me some hours to find out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top