> On 28 Feb 2016, at 17:55, Keary Suska <cocoa-...@esoteritech.com> wrote:
> 
> 
>> On Feb 28, 2016, at 8:10 AM, Dave <d...@looktowindward.com> wrote:
>> 
>> the winddowDidLoad method of my Window Controller is getting called twice. 
>> Is this expected behaviour? The window is the NIB has no views setup in the 
>> window ContentView, I add them after the window NIB has loaded. I’m guessing 
>> the second call is when I add subviews to the Content View…..
> 
> As I understand, no. No need to guess—set a break point and know.
> 

I have, it’s getting called twice, and I think I now know why, this is the 
windowDidLoadMethod

-(void) windowDidLoad 
{
LTWWindowBase*                                  myWindow;

//[super windowDidLoad];
        
myWindow = (LTWWindowBase*) self.window;
[myWindow initializeWindowWithWindowController:self];
}


It’s being called when I access the self.window, which is not surprising 
because accessing .window the first time triggers the loadWindow methods etc. I 
guess I can’t access .window from this method? The 
initializeWindowWithWindowController method adds the initial views to the 
Content View, is there another method where it is safe to do this? I suppose I 
could schedule it to run a short time after windowDidLoad has returned? What’s 
the recommended way of doing this?

Thanks for your help.

All the Best
Dave


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to