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

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


  • Follow-Ups:
    • Re: Superview and Subview Implementation Question
      • From: Jens Alfke <email@hidden>
  • Prev by Date: NSPopUpButton again
  • Next by Date: Re: NSPopUpButton again
  • Previous by thread: Re: NSPopUpButton again
  • Next by thread: Re: Superview and Subview Implementation Question
  • Index(es):
    • Date
    • Thread