I'm getting used to Interface Builder and Cocoa in general and I had a
"best practices" sort of question:

I have an AppController defined in my MainMenu.nib file that, in this
case, is the target of the "Preferences..." menu item. ( I don't know
if target is the right word exactly ).

I've also added a toolbar to my MyDocument.nib with a "Preferences"
toolbar item. To get this toolbar item to call the same method on the
AppController the Menu Item uses, I made the AppController the
delegate of the Application in MainMenu.nib. I created a NSApplication
outlet in MyDocument.h and a method for the Preferences toolbar item
to call. That method is defined as:

- (void)showPreferencePanel:(id)sender {
    [[application delegate] showPreferencePanel:sender];
}

to show the preferences pane of my application. This all works, but I
wanted to make sure there wasn't a "better" way of doing it.

I'd really like a way for the Toolbar Item to hit the AppController
directly to reduce the duplicated code.

Any suggestions would be appreciated.

Patrick
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to