ios 导航栏按钮添加与隐藏

在文件xxxViewController.m中,

// 添加前进按钮
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Forward2" style:UIBarButtonItemStylePlain target:self action:@selector(forwardButtonPressed:)];
self.navigationItem.rightBarButtonItem = rightButton;
    
// 隐藏返回按钮
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] init];
[leftButton setTitle:@""];
self.navigationItem.leftBarButtonItem = leftButton;

原文地址:https://www.cnblogs.com/ftrako/p/3524338.html