• 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: NSSaveView and odd NSCFArray errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSaveView and odd NSCFArray errors


  • Subject: Re: NSSaveView and odd NSCFArray errors
  • From: Jerry Seeger <email@hidden>
  • Date: Thu, 18 Sep 2003 14:56:54 -0700

It is for exactly things like that the response chain idea was created for in the first place. Since all the "regular" menu items communicate with your document that way, why not do the same thing for your custom ones? The system is just a very transparent way for a message to reach the right receiver. If you want the controller for the frontmost document to get the message, let Cocoa handle the message the same way it does for everything else.

Before I learned that I could add my own actions to First Responder in IB, I used methods in NSApplication to find the current document, but I was told at Big Nerd Ranch that that was definitely NOT the way to go. My code became much cleaner without that stuff. I don't know about *everyone*, but I know that many people do it that way.

Jerry

On Thursday, September 18, 2003, at 01:07 PM, Adam Knight wrote:

On Thursday, September 18, 2003, at 12:54 PM, Jerry Seeger wrote:

It's not a hack at all. The response chain is an excellent way to get the message to the right responder. You can add any custom actions you need to First Responder in IB if necessary as well, and implement those in your document controller. The right document controller will get the message every time. That can save you a lot of work.


So then this would be the expected way of dealing with this problem? I mean, I can deal with this being *a* solution but I'm unsure if it's *the* solution that "everyone else" is using. I've yet to find the source of a full-on document-based Cocoa app that implements it's own functions in menus (oddly, all I can find are prolific amounts of text editors).

TIA.
--
Adam
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSSaveView and odd NSCFArray errors
      • From: Adam Knight <email@hidden>
References: 
 >Re: NSSaveView and odd NSCFArray errors (From: Adam Knight <email@hidden>)

  • Prev by Date: Re: Async AppleScript Commands
  • Next by Date: Re: NSSaveView and odd NSCFArray errors
  • Previous by thread: Re: NSSaveView and odd NSCFArray errors
  • Next by thread: Re: NSSaveView and odd NSCFArray errors
  • Index(es):
    • Date
    • Thread