I saw in the documentation that now you can have an array of items for the leftBarButtonItems and rightBarButtonItems in a UINavigationController and don't have to create a UIToolBar and set that as the button. I basically want a "Home" button on the left next to the "back" button of the navigationController. So it would look like:
BackButtonFromNavigationController HomeBarButtonItem
I wasn't sure how I get the navigationBar's backButton into my array once I create my HomeButton. I tried this, but I only see the navigationController's backBarButton:
if ([self.navigationItem respondsToSelector:@selector(setLeftBarButtonItems:)]) {
UIBarButtonItem *hButton = [self createHomeButton];
self.navigationController.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:self.navigationItem.backBarButtonItem, hButton, nil];
}
Edited per smparkes response:
if ([self.navigationItem respondsToSelector:@selector(leftItemsSupplementBackButton)]) {
self.navigationItem.leftItemsSupplementBackButton = YES;
self.navigationItem.leftBarButtonItem = homeBBI;
}
I know homeBBI is created properly as I have it in my UIToolBar as the rightBarButtonItem prior to iOS 5. Now I'm just trying to move it to the left and I used the same button to see if it would work but it doesn't seem to work still...