Re: Windows in multiple NIBs
Re: Windows in multiple NIBs
- Subject: Re: Windows in multiple NIBs
- From: John Timmer <email@hidden>
- Date: Sun, 23 Dec 2001 12:43:42 -0500
Brian -
I've only done this in Java, but I can tell you how I do it and you can
translate that into Obj-C. The owner object you're passing with the method
winds up being the "file's owner" object in the nib. What I've found works
best is to create a custom class and hook up outlets to anything in the nib
you want to communicate with from the rest of the app. Then, select the
"file's owner" object and use the "attributes" section of the info panel to
set it to your custom class. Now, when you load your nib in the app, create
an instance of the custom class, store it somewhere permanent, then hand it
to the nib as the "owner" argument of the loadNibNamed method. Once the
method is done, all the outlets should be accessible via the object you
created.
Hope that's clear enough,
Jay
>
I'm trying to use a window that's inside a separate NIB, but I can't figure
>
out how to do it. From what I glean from the documentation, I need to use
>
like NSBundle's loadNibNamed:owner: to load the nib, and then do... ??
>
I need to be able to access the window's controller in the other nib so I
>
can pass data back and forth, also. No idea how I'd accomplish that.