Re: Toolbar code in separate Controller?
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