• 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: Enabling File Open/Save etc in a non-document-based application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling File Open/Save etc in a non-document-based application


  • Subject: Re: Enabling File Open/Save etc in a non-document-based application
  • From: Scott Ribe <email@hidden>
  • Date: Wed, 16 Apr 2008 14:48:59 -0500
  • Thread-topic: Enabling File Open/Save etc in a non-document-based application

> The File Open (for instance) menu item is already assigned, it sends
> openDocument: to FirstResponder. I can see it right there in the
> bindings, that menu item is already set up to call something.

Yes. But what is the first responder?

It is the user interface item which has focus. In many cases this will be a
control such as a text field, which does not respond to openDocument:, and
will pass it up the chain to the next responder an so on, until typically it
reaches the window, which does not respond either, but will give its
delegate a chance to respond, and if that doesn't handle it, it will go up
the application which will give its delegate a chance to handle it.

So the immediate answer to your question is that you need an instance of a
class that responds to openDocument: either a) assigned to be the
application delegate or b) assigned to be file's owner (set up in the nib by
setting the class of file's owner, and setting the file's owner to be the
window delegate).

Quincey gave you the outline already of the longer-view learning curve in
understanding the rest of how things fit together.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Re: Enabling File Open/Save etc in a non-document-based application (From: Roland King <email@hidden>)

  • Prev by Date: Re: binary search trees & binning
  • Next by Date: Re: Capture mouse events globally
  • Previous by thread: Re: Enabling File Open/Save etc in a non-document-based application
  • Next by thread: Re: Enabling File Open/Save etc in a non-document-based application
  • Index(es):
    • Date
    • Thread