Re: Delegates -- WHAT is delegated?
Re: Delegates -- WHAT is delegated?
- Subject: Re: Delegates -- WHAT is delegated?
- From: Sam Colombo <email@hidden>
- Date: Tue, 19 Dec 2006 23:59:24 -0600
That's exactly where I would expect to find it. I admit I am still
experiencing some culture shock going from MacApp to Cocoa, but I was hoping
for something that could architecturally meld with existing structure.
I keep reading things like "dont subclass -- delegate instead". Then
the first examples I see, the first thing they do is start subclassing
everything like NSView. If they'd let delegates handle the events and the
draw method instead of subclassing NSView, event handlers could be more
modular and more easily swapped out to handle different content in the same
view.
I can see why subclasses are good for the specialized views mentioned,
but where I am really going is the main view where I intend to have a s--t
load of layers and content types that each need their own handlers (i.e.,
controllers). I like the MVC concept, but I would like to keep the C out of
the V.
> Similarly, you're unlikely to find delegate support in the more abstract
> base classes like NSView and NSResponder, because they're generally not
> instantiated on their own. They serve as bases to inherit from, and
> they're too general to really benefit from delegates -- for example, he
> behavior you'd want from a delegate in an NSOutlineView is pretty
> different from what you'd want in an NSTextField, even though they both
> inherit from NSResponder.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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