如何以编程方式创建导航控制器的后退按钮?
解决方法
在 – (void)loadView或类似的:
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleBordered target:self action:@selector(backPressed:)]; self.navigationItem.leftBarButtonItem = btn; [btn release]; -(void)backPressed: (id)sender { [self.navigationController popViewControllerAnimated: YES]; // or popToRoot... if required. }