Can't get a simple toolbar functioning!
Extreme Objective-C/Cocoa noob.
Trying to follow Apple-eze about how to create a toolbar via interface builder but it's not working. (XCode4)
Tossed the bar into the window in IB, arranged the possibles and the default set of items. I set the images for the 'imag开发者_开发百科e toolbar items', labels, palette labels, tags, priorities. In XCode under identifier it says 'Auto-generated'. Checked 'Autovalidates'.
Created a class. Added the IBAction and that's where understanding fails. Apple's "Creating a Toolbar in Interface Builder" document winds up with a short "Setting the Target, Action, and Toolbar delegate" section where nothing jibes. My action appears nowhere in "Received Actions". The example code I've seen does a lot of this programatically.
- Is the class that handles the toolbar action declared as the nib file's owner?
- If not, are the methods in a class in the Responder chain? (probably not, but worth asking)
- Have you managed to set a delegate for the toolbar?
精彩评论