• 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: Subclassing NSWindowController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing NSWindowController


  • Subject: Re: Subclassing NSWindowController
  • From: Dietrich Epp <email@hidden>
  • Date: Fri, 6 Dec 2002 16:09:48 -0800

On Thursday, December 5, 2002, at 03:26 , Steve Martin wrote:

by default, I understand the Open and Save menu items will be disabled unless they are connected to Action methods (which can be done by ctl-dragging in IB). I think the normal way to handle this is with a delegate for the NSApplication that contains these Action methods and tells the document to save itself.

No.

The way to handle this is to connect Open & Save to the first responder. This is done by default, so nothing needs to be connected. First, the app tries to send the save: message to the first responder, then the next, until it succeeds. After the window, the next message will be sent to the window's delegate, which should be set to the window's controller or the document itself.

Make sure that the window's delegate is connected to the window's controller.

http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
BasicEventHandling/Concepts/AboutRespChain.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Subclassing NSWindowController (From: Steve Martin <email@hidden>)

  • Prev by Date: How to draw a horizontal line in a NSTextView?
  • Next by Date: How to run prefPane from Project Builder/gdb
  • Previous by thread: Re: Subclassing NSWindowController
  • Next by thread: Re: Subclassing NSWindowController
  • Index(es):
    • Date
    • Thread