Superview and Subview Implementation Question
Superview and Subview Implementation Question
- Subject: Superview and Subview Implementation Question
- From: Kip Nicol <email@hidden>
- Date: Thu, 8 May 2008 19:05:31 -0700
Hello all,
I've run into an implementation issue regarding the best way to
implement a view and its subviews. Maybe someone here can push me in
the right direction :)
I currently have a custom superview which holds custom subviews. These
subviews can be selected and moved around by clicking and dragging
them. The subviews also have a subview: a subclass of an NSMatrix. The
cells within the matrix can be selected by clicking and dragging the
mouse over the cells. So essentially my view hierarchy is:
SuperView ---> Subview ---> NSMatrix (subclass)
Currently the code to determine when the Subview is selected, how it
is moved about, and when and how the NSMatrix subclass's cells are
selected is distributed throughout the three views. It is now apparent
that this way is not modular and is creating a big headache in getting
things to work correctly.
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.
Thanks.
Kip
_______________________________________________
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