Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

communicating between multiple nibs

1 view
Skip to first unread message

Joe

unread,
Nov 9, 2009, 10:41:56 PM11/9/09
to
I have a document based application. There is an outlet in controllerA
of A.nib and I'd like to reference controllerB of B.nib. Both
controllers are subclassed from NSWindowController. I'm using xcode
3.2.1. What I'm trying to do is get controllerA send a message to
controllerB. What's really happening is the main window is making a
call to another window. Both windows are in their own nib files.

// from within controllerA
[controllerB do:something];

I've read this link but I didn't really understand how they were going
about it.
� � � �http://www.cocoadev.com/index.pl?MakingNibsTalkToEachOther

Can anyone help out here? Or am I even going about this correctly?

spikeysnack

unread,
Nov 10, 2009, 8:09:53 PM11/10/09
to

Nibs are files. Files don't communicate, objects do. Nibs contain
objects, but they are not working objects until they are woken up, at
which point the contained objects only know about those objects which
they have been connected to (as outlets or action targets), and
possibly the nib file's owner.


In InterfaceBuilder, set the FilesOwner property for the NibFile. Set
it to the class that owns the document window and you'll have
everything necessary to connect outlets and actions. The "instance"
you connect to is the FilesOwner icon in the Instances tab in
InterfaceBuilder.

ref. http://www.cocoadev.com/index.pl?FilesOwner


0 new messages