Re: Delegate ?
Re: Delegate ?
- Subject: Re: Delegate ?
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 14 Apr 2002 16:25:21 -0400
on 02-04-14 3:24 PM, Andy Lee at email@hidden wrote:
>
On a related note, if an AppKit class takes a delegate, you probably
>
don't want to subclass it. NSWindow, NSTextView, etc. are relatively
>
complex classes that have a lot of functionality and flexibility
>
built in so you won't have to subclass them. Rather, you extend
>
their behavior by other means such as delegation.
I think this statement is way too general. NSTextField and other text-based
controls, for example, take the window controller as their delegate
routinely to manage things like validating entries when editing ends. And
you are advised to subclass them any time you want to implement keyDown:,
for example, to implement mnemonics for keyboard control.
I would have said that you just have to be more careful when you subclass
more complex classes, to make sure you don't override functionality you
don't understand.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.