Building a Cocoa based user interface using the Interface Builder is really easy and produces great results quickly. But when I wanted to add a toolbar to a window, I had to realize, that Interface Builder does not support toolbars. So I started reading the apple developer documentation regarding the NSToolbar class and found out that it is actually easy to work with toolbars. There is just no Interface Builder support for them. So here comes a small howto about NSToolbar and its use in your applications.
Cocoa works with distinct toolbar identifiers to distinguish between multiple different toolbars in one application. The toolbars can be fully customized by the user and changes to a toolbar are synchronized to all toolbars with the same identifier. For example in an application with multiple edit document windows, all these windows would have a toolbar with the same identifier. If a user would change on toolbar, alle currently opened edit windows would synchronize their toolbars to the new changes.