我有一個UITableViewController。當我點擊一個單元格時,我想推新視圖。這工作正常,但新視圖沒有後退按鈕。爲什麼是這樣?後退按鈕不會出現在推送UIViewController
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;
}
}
您是否在您的父視圖中設置了'self.navigationItem.backBarButtonItem;'? – Nekto
ProfileViewController只有'self.navigationItem.rightBarButtonItem = replyButton;' –
不是ProfileView ** ProfileViewController的父**。 – Nekto