I have a UITableViewController. When I click on a cell I want to push a new view. This works fine, but the new view doesn’t have a back button. Why is this?
TableViewCode:
if([[NSUserDefaults standardUserDefaults] boolForKey:@"isLoggedIn"])
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
ProfileViewController* profileViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
profileViewController.message = [NSDictionary dictionaryWithObjectsAndKeys:cell.textLabel.text, @"user_login", @"default", @"message_source", nil];
switch(indexPath.row) {
case kUsernameRow:
[self.navigationController pushViewController:profileViewController animated:YES];
[profileViewController release];
break;
case kAboutRow:
break;
case kTOSRow:
break;
}
}
If your table view controller is created from nib, its default title is
@""(notice: notnil, but an empty string).Back button has a bug where it doesn’t display if title of previous controller on navigation stack is an empty string, so inside your table view controller, you need to set title to either
nilor some string in code, or some string in Interface Builder (can’t set it tonilthere afaik).