After I run my application in iOS 8 (XCode 6.0.1, iPhone 6), the back button does not hide.
My code:
- (void)removeCategoriesButton
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[_navigationController.topViewController.navigationItem setHidesBackButton:YES];
[_navigationController.topViewController.navigationItem setLeftBarButtonItem:nil];
} else {
UIViewController *controller = _app.window.rootViewController;
if ([controller isKindOfClass:[UINavigationController class]]) {
UINavigationController *nav = (UINavigationController *)controller;
[nav.topViewController.navigationItem setHidesBackButton:YES];
[nav.topViewController.navigationItem setLeftBarButtonItem:nil];
}
}
}
But the back button does not hide (see screenshot):
UPD:
I run application in another simulators, and i see this "bug" only on iOS 8.
This worked for me.
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationItem setHidesBackButton:YES];
[self.navigationItem setTitle:@"Home"];
}