Re: windowDidLoad getting called twice?
Re: windowDidLoad getting called twice?
- Subject: Re: windowDidLoad getting called twice?
- From: Dave <email@hidden>
- Date: Sun, 28 Feb 2016 18:40:43 +0000
> On 28 Feb 2016, at 17:55, Keary Suska <email@hidden> wrote:
>
>
>> On Feb 28, 2016, at 8:10 AM, Dave <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden