Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Bruno Silva

macrumors newbie
Original poster
Sep 2, 2008
27
0
Portugal
Hi, I'm fairly new to iOS development.

I have a NavigationView Based app with two UITableViews and several other normal views. The navigation goes from the first table to the second and then to a third view. I use Push and Pop to change views in the NavigationViewController. I tried to set a toolbar only on the second view with the table. However, I can't make the UIBarButtonItems to show on the toolbar, I think it doesn't have anything to do with the items I create because if I associate them to the navigation bar left or right button they work great.

This is the code I use to set the toolbarItems:

Code:
[self.navigationController setToolbarHidden:NO];
[self.navigationController setToolbarItems:[NSArray	arrayWithObjects:
	editButton, flexSpacer, filterControl	, nil]
animated:NO];

This code runs in the ViewDidLoad method.

I'm trying to understand why this doesn't work, any help is appreciated, thanks!

Bruno Silva
 

Bruno Silva

macrumors newbie
Original poster
Sep 2, 2008
27
0
Portugal
Found the answer, I knew I had to set the navbar items in the navcontroller, and I assumed it was the same for the toolbar, but it is not, you need to set it on whatever UIViewController you're showing :)

Bruno.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.