Re: NSDocument: Connecting the menubar to objects?
Re: NSDocument: Connecting the menubar to objects?
- Subject: Re: NSDocument: Connecting the menubar to objects?
- From: Fritz Anderson <email@hidden>
- Date: Mon, 13 Jun 2005 22:07:06 -0500
On 13 Jun 2005, at 5:09 PM, Theodore H. Smith wrote:
I'm wondering how do I connect the menubar to objects, in an
NSDocument based project.
Heres what I have: One nib with a file's owner of NSApplication,
and all the menu targets connected up to the app.
Another nib with a file's owner of MyDocument (NSDocument subclass).
I want the menu to call action targets in the the document.
How do I do this? Must I subclass NSApplication to redirect the
stuff across to MyDocument? But that wouldn't work, would it,
because the NSApplication is already instantiated for me.
So how do I do this? I can't figure it out.
The front NSDocument is automatically in the responder chain. Link
the menu items to the First Responder, and the action method will get
shopped up the chain until it hits your document subclass. Review the
NSResponder/responder chain documentation.
-- F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden