I'm developing a TabBar based application with an UIViewController witch appear when a cell is selected in the first view. I would like to add an UIToolBar with some informations (in the items) given by the segue of the selected cell. I already tried the code bellow (found in a similar question) but it doesn't work :
if (self) {
NSArray* toolbarItems = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(addStuff:)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch
target:self
action:@selector(searchStuff:)],
nil];
[self setToolbarItems:toolbarItems];
[self.navigationController setToolbarHidden:NO animated: YES];
}
return self;
Does anyone knows another way to add a new UIToolBar over the one inferred by the Navigation Controller ?
I solved my problem by adding an IBOutlet UIToolBar and defining it as the view's toolbar.
theToolBar = [[self navigationController] toolbar];