w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how do i change the back button title in a view controller pushed with a segue as below in ios5

after a lot of searching and trying various solutions on this forum, i finally got something that works which i am posting below for the benefit of others that get stuck at this point.

- (void)prepareForSegue:(UIStoryboardSegue *)segue
sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"infoRegularSegue"])
    {


        FirstViewController *destViewController =
segue.destinationViewController;
        destViewController.title = NSLocalizedString(@"Information", title
of information view);

        //here is the solution to my problem
        UIBarButtonItem *backButton = [[UIBarButtonItem
alloc]initWithTitle:NSLocalizedString(@"Return", returnbuttontitle) style: 
   UIBarButtonItemStyleBordered target:nil action:nil];
        self.navigationItem.backBarButtonItem = backButton;

    }
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.