我有一个导航控制器。控制器运行良好,并向我显示返回按钮以返回窗口。但是当我添加此代码以添加关闭按钮时:
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Chiudi"
style:UIBarButtonItemStylePlain target:self
action:@selector(dismissModalViewControllerAnimated:)];
self.navigationItem.rightBarButtonItem = doneButton;
[doneButton release];
}
...然后后退按钮消失,我只能看到关闭按钮。为什么?