• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: windowDidLoad getting called twice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >windowDidLoad getting called twice? (From: Dave <email@hidden>)
 >Re: windowDidLoad getting called twice? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: windowDidLoad getting called twice?
  • Next by Date: Re: windowDidLoad getting called twice?
  • Previous by thread: Re: windowDidLoad getting called twice?
  • Next by thread: Re: windowDidLoad getting called twice?
  • Index(es):
    • Date
    • Thread