My application layout is as follows:
rootViewController is a tabViewController with 3 tabs, each of which has a UINavigationController as its rootViewController. In one of these tabs, I click on the cell selection on another tabController, which now has two tabs. What I'm trying to do is set rightBarButtonItem for each of these two viewControllers tab elements ... in the viewDidLoad method of both of them I do:
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(selectionChanged:)];
however, it does absolutely nothing! I thought from the Apple docs that you can set navigationItem rightBarButtonItem from anywhere in the hierarchy of your navigation controller, but it doesn't seem to be that way. Any idea what - if anything - am I doing wrong?
ios uinavigationitem uinavigationcontroller uibarbuttonitem
simonthumper
source share