I have a parent view controller that sets up the navigation bar with a custom back image and a right bar button item. For some reason one individual screen which is pushed by two different controllers doesn't show the back button image until I press it. Then it's there for good. Anyone come across this? Here is my button code being called in view did load.
// In my app delegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Setup custom back button
UIImage *backButton = [UIImage imageNamed:@"backButton"];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[backButton resizableImageWithCapInsets:UIEdgeInsetsMake(0, backButton.size.width, 0, 0)]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
}
// In the parent view controller that all of the others inherit from
- (void)viewDidLoad
{
[super viewDidLoad];
// Custom Back Button
UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
initWithTitle: @" "
style: UIBarButtonItemStyleBordered
target: nil action: nil];
[self.navigationItem setBackBarButtonItem: backButton];
}
This works fine on all screens except one no matter which VC it's pushed from. But the one has a hidden image until the button is pressed.