我在情节提要中拖出一个工具栏项并将其设置在我的导航控制器上,但是当我运行我的代码时它不存在,是我遗漏了什么吗?
编辑:
尝试在代码中设置它以及在我的 viewDidLoad 方法中:
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"Map" style:UIBarButtonItemStyleBordered target:self action:@selector(viewMap)];
self.navigationItem.rightBarButtonItem = rightBarButton;
也不行。
这是它在我的故事板中的设置方式:
更新:
刚发现我的问题。在我的控制器代码中,当我更新它的内容时,我更改了微调器的右栏按钮项,并且从未将其设置回以前的状态。