我有导航控制器,我想更改 appdelegate 上的导航后退按钮文本。所以我想在 appdelegate 上更改每个 uiviewController 的后退按钮的文本。可能吗?
我写了以下代码,但它不工作。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
navigationController=[[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewController = self.navigationController;
self.navigationController.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@"custom back text"
style:UIBarButtonItemStyleBordered
target:nil
action:nil]; // didn't work
[self.window makeKeyAndVisible];
return YES;
}