• 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: Superview and Subview Implementation Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Superview and Subview Implementation Question


  • Subject: Re: Superview and Subview Implementation Question
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 9 May 2008 08:08:25 -0700


On 8 May '08, at 7:05 PM, Kip Nicol wrote:

I was wondering if anyone thought that it would be better to implement all of the control code (when subviews are selected, moved, cells selected, etc) solely within the custom superclass? This way sounds like it may be more work up front, but in the long run it may make more sense to do it this way.

It sounds like the subview selection/moving code belongs in either the root view or the subviews, but not both; and the subviews should deal with cell selection. Managing the views and selecting cells sound like different activities.


If you override -hitTest: in the root view, that method can detect clicks in subviews and route them to the root view instead; then the root can manage the selection/moving of the subviews. I've done that in one of my apps.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Superview and Subview Implementation Question
      • From: Kip Nicol <email@hidden>
References: 
 >Superview and Subview Implementation Question (From: Kip Nicol <email@hidden>)

  • Prev by Date: Re: How to send email without using email client
  • Next by Date: Re: How to send email without using email client
  • Previous by thread: Superview and Subview Implementation Question
  • Next by thread: Re: Superview and Subview Implementation Question
  • Index(es):
    • Date
    • Thread