我已经创建了一个基于导航的应用程序模板的项目,并做了一些工作,并运行它。按钮不显示在导航栏项
我想如果我触摸一个单元格,新的视图会显示出来,并且新的图标(它将返回按钮)也会显示在导航栏项目上。
但由于某种原因,“后退按钮”不会自动添加。有什么问题?
以下是我的代码。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here -- for example, create and push another view controller.
MessageView *detailViewController = [[MessageView alloc] initWithNibName:@"MessageView" bundle:nil];
NSDictionary* aMessage = [m_tableData objectAtIndex:indexPath.row];
detailViewController.m_message = [[NSDictionary alloc] initWithDictionary:aMessage];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
它是您推入导航控制器的视图(MessageView)吗?你只能推UIViewController而不推UIView – Nevin 2011-02-23 01:56:03