1. How to edit tabBar items in tabBarController?
[[self.tabBarController.tabBar.Items objectAtIndex:(Integer)] setTitle:(NSString)]
2. how to edit/define back/leftBarButton's title in navigationController?
There are three button types in navigationBar:
a. leftBarButtonItem, you can define a custom leftBarButtonItem of navigationBar in the view controller where the button is.
b. backBarButtonItem, you can define custom backBarButtonItem of navigationBar in the superview controller where the button is.
c. default Button, if you don't define anything(left and back all nil), navigationController will auto-generate a back button.
setBackBarButtonItem method: Important! Assuming now have two view controllers which called A&B, and you want to change B's back Button. So setBackBarButtonItem must be wrote in A.
// backBarButtonItem doesn't need to put target and action, because it will work as function of back button.
[[UIBarButtonItem alloc] initWithTitle:@"Customize backButton"
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
[[self navigationItem] setBackBarButtonItem:newBackButton];
setLeftBarButtonItem method:
Important! Writing these codes to customize button in view controller which you want to customize it.
// Don't forget to put target and action, or it doesn't work as button.
[[UIBarButtonItem alloc] initWithTitle:@"Customize leftButton"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(-method)];
[[self navigationItem] setLeftBarButtonItem:newBackButton];
P.S.: Left/back button instance variable is nil at begin in the navigationController, if want to change anything for left/back button, you must to create an UIButton object and assign to navigationController.
3. Performing segue after executing something what you want to do.
There are two steps:a. When you establish push relationship between view controllers, don't make it on button. Building it at any non-trigger component.
b. Using the method which show as below to jump to next view after complete all what you want to execute.
[self performSegueWithIdentifier:NSString sender:(id)]