I am using the Master-Detail template from XCode 4.3.1 and want to access the toolbar on the detailView control.
[self navigationItem] setTitle:
sets the title, but I can’t figure out how to add barButtonItems either through the xib or programmatically. In the past, with an earlier SplitView Template (when master view was called root view) I could access the rootView toolbar through the Split View Controller in MainWindow.xib and I had the detailView toolbar right there in the detailView.xib file.
What is the best way for me to set these items (I have 4) on the detailView toolbar?
Thanks in advance.
So I’ve got an answer – please let me know if you have a better one!
In the viewDidLoad method of my masterViewController I populated the toolbar on the detail view with
I had created these buttons with
I had declared each of these buttons in the detailViewController.h file so that I could reference them later, but probably didn’t need to use those names – it just made the code longer here. I also had a uiButton that I could not add in the array of buttons, so I created a the button, put it inside a View and then set that as the titleView for the navigation item: