Similar to a table view, we need to implement a delegate for our toolbar. Again, as its name implies, the toolbar delegate will implement behaviors on behalf of the GUI object.
From the File menu, select New, then select New File… and create a new class named
BTS_NCToolbarDelegate
that will be used to manage the table views.Select the MainMenu.xib file and create a new object from the Object Library.
Change the name of the new object to BTS_NCToolbarDelegate.
Change the class of the new object to BTS_NCToolbarDelegate.
In the .
xib
file, connect the Toolbar object to the BTS_NCToolbarDelegate object and select delegate from the Outlets menu as shown in the following screenshot:In
BTS_NCToolbarDelegate.h
, add the following code to define the interface. It defines a single method that will be used to handle all the Toolbar Item objects.// Handle the Toolbar Item selection - (IBAction)selectToolbarItem:(id)a_sender;
Connect the dataSource and delegate...