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: Shaun Wexler <email@hidden>
- Date: Wed, 2 Jul 2003 18:48:16 -0700
As Seth pointed out, you should have a base controller class, so the
various nib controllers which inherit from it can provide optional
functionality. One way to structure your base nib is to make the
"variable" section(s) custom views, and replace them with alternate
views from the misc nib files, themselves containing only the
replacement views, etc.. If you wanted to rearrange objects from the
base nib, you could manipulate their frames within the subclasses view
controllers, deleting them, adding new objects, such as if you're doing
a "skins" theme. It sounds like you may want to rethink your
controller class hierarchy. Having 7 or 8 controllers for one nib is
not a good idea. A better recommendation would be possible if we knew
more about your project's needs. Screenshots would do wonders... ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
On Wednesday, July 2, 2003, at 03:52 PM, Michael Norris wrote:
Knowing Cocoa, I'm sure there's an easy and elegant solution to the
following problem. I would appreciate any pointers in the right
direction.
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.
The advantage of this approach, if it's possible, is that if I decide
to change the core functionality at any stage, I can simply change the
view in one place, and it would (ideally) update in all my other nibs.
So, is there any way I can get a view to be shared between nibs?
_______________________________________________
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.