FROM : Jim Murry
DATE : Fri Jan 04 09:46:06 2008
I dealt with this after trying to reduce nib sizes and make various
parts of my program reusable. I found that if I set File's Owner to
my "Main Controller" in these "sub-controller" nib files and then add
a new NSObject that I set the class in the inspector window to my "sub-
controller." This keeps the circular initialization from occurring,
while allowing cross communication between the nib files.
Hope this helps.
On Jan 3, 2008, at 10:16 AM, Nathan Auch wrote:
> My application is an installer whose main window consists of a few
> controls and an area (NSBox) on which one of several "panels" is
> displayed. As the user progresses through the install, theses panels
> (custom NSViews) are swapped in and out of the main window. The
> logic for some of the panels can be quite complicated so I've
> implemented a unique controller for each panel which holds all the
> logic pertaining to it.
>
> The main controller holds a pointer to each of the panel controllers
> so that it handle swapping the panels. Some of the panel controllers
> need to communicate with the main window controller as well to do
> things like set the enabled status of the "Continue" and "Go Back"
> buttons on the main window.
>
> Thus, the main window controller has an IBOutlet for a panel
> controller, and the panel controller has an IBOutlet for the main
> window controller. These are both assigned in Interface Builder.
> After loading the NIB file, the IBOutlet pointing to the main window
> controller from the panel controller is never set (value is nil). I
> think this must be because there is a circular dependency during
> initialization of the NIB file.
>
> Is this expected behaviour? Can I do something to force the
> initialization of both outlets, or do I just need to work around
> this in my code? (Working around this shouldn't be difficult, but
> I'm new to Cocoa, so I just want to make sure that I correctly
> understand what is going on before working around the issue.)
>
> Thanks,
> -Nathan
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Fri Jan 04 09:46:06 2008
I dealt with this after trying to reduce nib sizes and make various
parts of my program reusable. I found that if I set File's Owner to
my "Main Controller" in these "sub-controller" nib files and then add
a new NSObject that I set the class in the inspector window to my "sub-
controller." This keeps the circular initialization from occurring,
while allowing cross communication between the nib files.
Hope this helps.
On Jan 3, 2008, at 10:16 AM, Nathan Auch wrote:
> My application is an installer whose main window consists of a few
> controls and an area (NSBox) on which one of several "panels" is
> displayed. As the user progresses through the install, theses panels
> (custom NSViews) are swapped in and out of the main window. The
> logic for some of the panels can be quite complicated so I've
> implemented a unique controller for each panel which holds all the
> logic pertaining to it.
>
> The main controller holds a pointer to each of the panel controllers
> so that it handle swapping the panels. Some of the panel controllers
> need to communicate with the main window controller as well to do
> things like set the enabled status of the "Continue" and "Go Back"
> buttons on the main window.
>
> Thus, the main window controller has an IBOutlet for a panel
> controller, and the panel controller has an IBOutlet for the main
> window controller. These are both assigned in Interface Builder.
> After loading the NIB file, the IBOutlet pointing to the main window
> controller from the panel controller is never set (value is nil). I
> think this must be because there is a circular dependency during
> initialization of the NIB file.
>
> Is this expected behaviour? Can I do something to force the
> initialization of both outlets, or do I just need to work around
> this in my code? (Working around this shouldn't be difficult, but
> I'm new to Cocoa, so I just want to make sure that I correctly
> understand what is going on before working around the issue.)
>
> Thanks,
> -Nathan
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>






Cocoa mail archive

