Skip navigation.
 
mlRe: IBOutlet, multiple nibs, method duplication
FROM : Andrew Merenbach
DATE : Tue Jun 03 23:25:54 2008

Hi, Trygve,

With regard to your code duplication, I would use a common 
NSWindowController superclass, with a subclass for your main window 
and a subclass for your aux window.  Then you can just use the right 
nib name in each of them, but leave the rest of the code identical.

Cheers,
   Andrew

On Jun 3, 2008, at 2:21 PM, Trygve Inda wrote:

> Hi All,
>
> Sorry for the vague subject title... Let me explain.
>
> I have one window per attached screen so at least one, but perhaps 3 
> (for
> example). There is always one "main" window and the others are 
> considered
> "aux windows".
>
> The Main window has 4 groups of controls (A, B, C, D).
> The Aux windows have only group A.
>
> I would like to have one controller object handle group A regardless 
> of
> being main/aux.
>
> Currently I have 6 methods in "mainWindowController" which are 
> identical to
> 6 methods in "auxWindowController". auxWindowController has an 
> additional
> method or two used to create and center the window from auxWindowNib
>
> It'd be nice to not have this duplication.
>
> The main window and aux window use different Nibs so each nib has a
> "somePopupMenu" and each controller has an IBOutlet... MyPopupMenu
>
> Etc.
>
> Since the IBOutlets in Main point to a different Nib than the 
> IBOutlets in
> Aux (even though they are functionally identical) is there a good, 
> clean way
> to manage this?
>
> Or is it better to keep them separate and just have 6 methods that 
> are 99%
> the same in different objects. (Basically the Aux controller is a 
> subset of
> Main Controller, but is not really a child).
>
> Thanks,
>
> Trygve
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/andrew.<email_removed>
>
> This email sent to andrew.<email_removed>

Related mailsAuthorDate
mlIBOutlet, multiple nibs, method duplication Trygve Inda Jun 3, 23:21
mlRe: IBOutlet, multiple nibs, method duplication Andrew Merenbach Jun 3, 23:25
mlRe: IBOutlet, multiple nibs, method duplication Trygve Inda Jun 3, 23:48
mlRe: IBOutlet, multiple nibs, method duplication Andrew Merenbach Jun 4, 07:52
mlRe: IBOutlet, multiple nibs, method duplication Trygve Inda Jun 4, 09:09
mlRe: IBOutlet, multiple nibs, method duplication Hamish Allan Jun 4, 20:52
mlRe: IBOutlet, multiple nibs, method duplication Trygve Inda Jun 4, 21:17
mlRe: IBOutlet, multiple nibs, method duplication Hamish Allan Jun 4, 21:41
mlRe: IBOutlet, multiple nibs, method duplication Trygve Inda Jun 4, 21:46
mlRe: IBOutlet, multiple nibs, method duplication Hamish Allan Jun 4, 22:05