Monday, 26 August 2013

iOS >> UINavigation Item Back Button Title Doesn't Change

iOS >> UINavigation Item Back Button Title Doesn't Change

I'm trying to set the BACK button for a pushed VC set within a
UINavigationController stack. I use the following code, and it's not
working - I still get the previous VC name appearing as the back button
title.
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.title = @"VC Title";
UIBarButtonItem* myBackButton = [[UIBarButtonItem alloc]
initWithTitle:@"Back"
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
self.navigationItem.backBarButtonItem = myBackButton;
}
Anyone?

No comments:

Post a Comment