Re: IBOutlet to same control in different nibs
Re: IBOutlet to same control in different nibs
- Subject: Re: IBOutlet to same control in different nibs
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 18 Jul 2008 01:29:31 -0400
On Thu, Jul 17, 2008 at 12:42 PM, Trygve Inda <email@hidden> wrote:
> Can a single class have an IBOutlet that goes two different (though
> functionally identical) places?
Yes, if what you're asking is "can I load a nib once with one object
as File's Owner and then again with a different object?" I'd probably
create many nibs, in fact, one for each view in the NSTabView. So
there would be TabA.nib, TabB.nib, etc. I would then create a nib for
the window, let's call it Window.nib, containing an NSTabView with
four *empty* tabs, A through D. I'd also create two
NSWindowController subclasses, MainWindowController and
AuxWindowController. For the main screen, use MainWindowController to
load Window.nib with self as file's owner, and then use the new
NSViewController to load the contents of each of the tabs.
AuxWindowController would be File's Owner for the windows on the other
three tabs, but would remove tabs B through D from the tab view,
before loading the view for tab A using NSViewController. You can
then use the representedObject of each NSViewController instance you
create to get back to your application logic.
Hope that helps.
--Kyle Sluder
_______________________________________________
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