• 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
Customizing controls: Inheritance bad?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Customizing controls: Inheritance bad?
      • From: Negm-Awad Amin <email@hidden>
    • Re: Customizing controls: Inheritance bad?
      • From: Andy Lee <email@hidden>
    • Re: Customizing controls: Inheritance bad?
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Re: Parsing xml files in Cocoa applications
  • Next by Date: Type comparison warning
  • Previous by thread: Re: Porting from Windows to Mac
  • Next by thread: Re: Customizing controls: Inheritance bad?
  • Index(es):
    • Date
    • Thread