I am trying to add toolBarItems in BNRItemsViewController in viewDidLoad, below is the code
UIBarButtonItem *bbiItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(pickItem)];
// Create Array initialized with bar button item
NSArray *toolBarItems = [[NSArray alloc] initWithObjects:bbiItem, nil];
// toolBarItems are automatically picked and set by the navigation controller [self setToolbarItems:toolBarItems animated:YES];
When I try state restoration for BNRItemsViewController, the UINavigationController toolBar is not set, running normally displays it, I have tried debugging it and what I understand is that the view of the BNRItemsViewController gets loaded after the UINavigationController has been created, that’s the reason it does not pick the toolBarItems set in itemViewController, there is no control in explicitly pushing the view controller for state restoration, the current code in the book does not address this I think, is there a way to update in ViewWillAppear?