• 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: Toolbar code in separate Controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toolbar code in separate Controller?


  • Subject: Re: Toolbar code in separate Controller?
  • From: "John Love" <email@hidden>
  • Date: Thu, 17 Jul 2008 13:05:55 -0400

... and the lights went on ... and I hear fireworks!

Andy said "I think of each of those bunches as categories of methods."

YES!, not a category of an object, but a logically separate category of
methods belonging to the object.  So,

   @interface MyDocument (NSToolbarItemValidation)

adds the methods of NSToolbarItemValidation to MyDocument.

Now ... to delegate stuff ... I've reached a conclusion based on ADC's
"Cocoa and Objective-C" and on good-ole MW (haven't gotten "Design Patterns"
yet) that:

(1) the sheet is the delegate of FC because the FC is asking the sheet what
to do and the FC implements the sheet's decision

(2) (here is when the lights went on) the FC is the delegate of the NSWindow
because the window is asking the FC what to do and the window implements the
FC's returned decision.  OF COURSE the FC is the delegate of the NSWindow
because that is the way IB has this relationship hooked up.

(3) because the delegate "chain" is a chain, I have to go back up the chain
and ask "Who is the original delegate?" .. and the answer, my friends, is
the FC which is the delegate of NSWindow.

    the window asks the FC, which then asks the sheet .. the original
delegate = FC, so that's what we always call the FC.

Again, life is good!

John
_______________________________________________

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

  • Follow-Ups:
    • Re: Toolbar code in separate Controller?
      • From: Graham Cox <email@hidden>
    • Re: Toolbar code in separate Controller?
      • From: Andy Lee <email@hidden>
References: 
 >Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Uli Kusterer <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Graham Cox <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Graham Cox <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: "John Love" <email@hidden>)
 >Re: Toolbar code in separate Controller? (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: how do I make chat bubbles using a custom cell
  • Next by Date: Re: Concurrent network transmission
  • Previous by thread: Re: Toolbar code in separate Controller?
  • Next by thread: Re: Toolbar code in separate Controller?
  • Index(es):
    • Date
    • Thread