• 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
Re: Delegates -- WHAT is delegated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Delegates -- WHAT is delegated?
      • From: Dustin Voss <email@hidden>
    • Re: Delegates -- WHAT is delegated?
      • From: Uli Kusterer <email@hidden>
References: 
 >Re: Delegates -- WHAT is delegated? (From: Nat Lanza <email@hidden>)

  • Prev by Date: Re: strange zombie NSTask which never completes on certain machines...
  • Next by Date: assigning the same keyboard command to more than one menu item
  • Previous by thread: Re: Delegates -- WHAT is delegated?
  • Next by thread: Re: Delegates -- WHAT is delegated?
  • Index(es):
    • Date
    • Thread