Re: Superview and Subview Implementation Question
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