• 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: Making an object accessible by both MyDocument AND a custom class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making an object accessible by both MyDocument AND a custom class


  • Subject: Re: Making an object accessible by both MyDocument AND a custom class
  • From: James DiPalma <email@hidden>
  • Date: Wed, 25 Sep 2002 12:59:09 -0400

You could make sure that MyCustomObject was the delegate of NSApp. The easiest way to accomplish this would be to connect them in MainMenu.nib... File's Owner -> MyCustomObject. Then you could message MyCustomObject from most any object by sending messages to nil. The messages would go up the responder chain and end up at your single instance of MyCustomObject.

[nil tellMyCustomObjectToDoSomething];

NO! sending a message to nil will do nothing.

Look at NSApplication and documentation for its method -sendAction:to:from: it gives a brief description of how the responder chain is used when sending actions.


-jim


P.S. I respect that people are trying to do what is right by participating and answering questions, but this post contains enough information to sound like it might be correct, but is in fact very misleading.
_______________________________________________
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.
  • Prev by Date: Re: [Q] Unlocking an arbitrary file?
  • Next by Date: Re: Open GL Texturing Example...
  • Previous by thread: Re: Making an object accessible by both MyDocument AND a custom class
  • Next by thread: Re: Making an object accessible by both MyDocument AND a custom class
  • Index(es):
    • Date
    • Thread