Re: Using an IB-built view multiple times
Re: Using an IB-built view multiple times
- Subject: Re: Using an IB-built view multiple times
- From: Christopher Drum <email@hidden>
- Date: Wed, 21 Sep 2005 09:20:47 -0700
I'll take a look at that code, thank you.
In the meantime, I have successfully accomplished the task at hand.
The trick I kept overlooking was setting the class of File's Owner in
the template nib and hooking the nib tools up to that. Now, when I
instantiate the nib programatically and give it an over of that
class, everything works out just fine... and it only took about 20
lines of code to get the concept working in a test app. My popup menu
in the template nib is acting squirrely when its placed as subviews
into a main view, but otherwise I believe I understand the order of
events better now.
Christopher Drum
On Sep 21, 2005, at 6:48 AM, John Bishop wrote:
You need to look at the MultipleNibTabView sample code. It shows
you nicely
how to repeatedly use the same (or different) nib files to populate
views -
which in its case is a tab view. It'll work any way you wish to
use it.
The bindings are not a problem either... since the nib contains a
controller,
along with the view, you can just wire up the content to your model
after
loading the nib and installing the view into your master view.
Each view can
therefore represent a different instantiation, with its own
contrller, of the
same class. You usually need to keep track of something (the
controller, the
view or some controller of your own) so you can free it when it
goes away, but
that's not too hard.
Christopher Drum <email@hidden> said:
No, I'm sorry if my original explanation was confusing. I mean, I
want to build a view in IB, then use that view repeatedly to populate
some master view programatically. I have found an example of this in
some sample Apple code in the CoreRecipes application. There is an
------------------------------------------------------------------
John Bishop <mailto:email@hidden>
Mulligan Software <http://www.mulligansoftware.com>
Mulligan's Golf Personal - Stats & Handicapping for the Mac Golfer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden