• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDocument: Connecting the menubar to objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSDocument: Connecting the menubar to objects?
      • From: "Theodore H. Smith" <email@hidden>
References: 
 >NSDocument: Connecting the menubar to objects? (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: Spotlight Importer for files in "Project-Based" folder
  • Next by Date: Re: Cocoa-Java-based Universal Binary?
  • Previous by thread: NSDocument: Connecting the menubar to objects?
  • Next by thread: Re: NSDocument: Connecting the menubar to objects?
  • Index(es):
    • Date
    • Thread