Customizing controls: Inheritance bad?
Customizing controls: Inheritance bad?
- Subject: Customizing controls: Inheritance bad?
- From: "Brian Williams" <email@hidden>
- Date: Thu, 30 Oct 2008 11:51:55 -0400
- Thread-topic: Customizing controls: Inheritance bad?
Hello,
I'm brand new to Cocoa/Obj-C and I'm working on converting an app. to
use Cocoa...
I've heard that, in general, if you are using inheritance in Cocoa,
you're not following the typical standard design pattern. Is this true?
To respond to special keyboard events in an NSTableView, I created a
subclass and provided an implementation for keyDown.
To draw some customized stuff in an NSColorWell, I created a subclass
and provided an implementation for drawRect.
Etc.
In the olden days, this kind of object-oriented approach was perfectly
correct.
But I'm told I should be using delegate methods and firstResponders
somehow.
In general, is there a preferred approach to using actions over
delegates, and delegates over handling Cocoa events? It seems there are
many different ways to handle the same problem and some ways are
preferred over others...
Also, could someone recommend a good intro to FirstResponders as this is
a concept I don't understand fully yet?
Thanks,
Brian
_______________________________________________
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