FROM : Christiaan Hofman
DATE : Fri Apr 01 19:48:30 2005
On Apr 1, 2005, at 20:27, Marc Respass wrote:
> Hi All,
>
> I have two windows, Main and Login. Both use the same controller for
> user information, userController (an NSObjectController). I have one
> controller object, Controller.m, which is the main controller for the
> app and the owner of Login.nib. If I connect userController in
> MainMenu.nib and Login.nib, I get two different instances of
> userController so I only connect it in Login.nib and it only gets
> initialized when the Login panel goes up (which is fine since it's
> useless until a user logs in). The userController remains the same and
> it contains all the data I want but I am unable to display information
> from it in my main window (in MainMenu.nib). Any ideas about why or
> how to handle this?
>
> thanks a lot
> Marc
>
This should work, in principle. But how do you connect, and when? In
the way you describe the userController is instantiated with Login.nib,
while you want to connect it to views in the Main.nib. Both nibs should
therefore have been loaded when you do the programmatic binding.
But why not just live with the 2 controllers?
BTW, if you are not aware of this, do not bind to the Nib file owner,
because of a retain loop bug.
Christiaan
DATE : Fri Apr 01 19:48:30 2005
On Apr 1, 2005, at 20:27, Marc Respass wrote:
> Hi All,
>
> I have two windows, Main and Login. Both use the same controller for
> user information, userController (an NSObjectController). I have one
> controller object, Controller.m, which is the main controller for the
> app and the owner of Login.nib. If I connect userController in
> MainMenu.nib and Login.nib, I get two different instances of
> userController so I only connect it in Login.nib and it only gets
> initialized when the Login panel goes up (which is fine since it's
> useless until a user logs in). The userController remains the same and
> it contains all the data I want but I am unable to display information
> from it in my main window (in MainMenu.nib). Any ideas about why or
> how to handle this?
>
> thanks a lot
> Marc
>
This should work, in principle. But how do you connect, and when? In
the way you describe the userController is instantiated with Login.nib,
while you want to connect it to views in the Main.nib. Both nibs should
therefore have been loaded when you do the programmatic binding.
But why not just live with the 2 controllers?
BTW, if you are not aware of this, do not bind to the Nib file owner,
because of a retain loop bug.
Christiaan
| Related mails | Author | Date |
|---|---|---|
| Marc Respass | Apr 1, 19:27 | |
| Christiaan Hofman | Apr 1, 19:48 | |
| Marc Respass | Apr 1, 20:15 | |
| Christiaan Hofman | Apr 1, 20:26 | |
| Marc Respass | Apr 1, 23:17 |






Cocoa mail archive

