Re: Can I "share" a view between nibs?
Re: Can I "share" a view between nibs?
- Subject: Re: Can I "share" a view between nibs?
- From: The Amazing Llama <email@hidden>
- Date: Wed, 2 Jul 2003 16:29:52 -0700
What you need to do is put the view you want to reuse in it's own NIB,
and then load that nib over and over as many times as you need: one
load, one instance. Pop it in whenever you need it.
I find it very nice to define a controller for most NIBs I define this
way, and set that controller to be the NIB's owner. Then I can just
call [controllerClass view] and it'll hand me the NSView that I want to
reuse. This design probably has a name, but I don't know what it is.
It's flexible and easy.
On Wednesday, July 2, 2003, at 03:52 PM, Michael Norris wrote:
I'm working on a project with multiple nibs. Many of these nibs are
"variations on a theme": there are some controllers which have
nib-specific functionality and some which are the same for every nib.
It would be nice if I could create a single view in MainMenu.nib for
the "generic" controllers, and then have all my auxiliary nibs use
that view alongside the controllers that are specific to each nib.
Rather than recreating the 7 or 8 controllers for each nib, like I'm
doing now. I'd also need to be able to wire the individual controllers
to outlets and actions in IB.
Seth A. Roby The Amazing Llama < mail or AIM me at tallama at mac dot
com>
"Life is like an exploded clown. It's really funny until you figure out
what just happened."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.