On Jun 9, 2009, at 16:15, Stephen Blinkhorn wrote:

Imagine I have an NSTabView with 10 tabs that all contain the same collection of controls. The only difference is that each control's action/outlet is connected to a different controller object (of the same class type). Is it possible to select a whole tab of controls, copy them to the next tab and somehow change all the connections to and from Controller1 so that they now connect to Controller2,3,4,5,6 etc without having to do 300 CTRL drags.

Perhaps this illustrates an underlying fundamental problem with the structure of my app but I don't want to know about that right now :) Well, ok, maybe I do...

In the absence of further information, it seems that a tab view is wrong approach here. If all the so-called tabs are identical in user interface terms (that is, the only difference is the data they retrieve from your data model), you'd probably do better with a single set of the controls and a segmented control to choose which set of data values to use.

If you must use a tab view, you could also approach it with a view xib and a view controller to define the common part of each tab. The view controller would act as an intermediary to pass the action methods on to the correct controller. (The details, and feasibility, of this approach might depend on exactly what class of controllers you're trying to use.)


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to