Re: swift: windowControllerDidLoadNib called twice
Re: swift: windowControllerDidLoadNib called twice
- Subject: Re: swift: windowControllerDidLoadNib called twice
- From: Boyd Collier <email@hidden>
- Date: Wed, 23 Sep 2015 12:08:06 -0700
Thanks, Quincey, for taking the trouble to respond. I’m pleased to say that after far too many hours of going over the details of my code (and having to make a trip to our local Apple store to get my “magic mouse” replaced), it is now working correctly. I’ve been writing code for Macs off-and-on for 30 years, and once again I conclude that dogged persistence is an essential attribute. Undoubtedly, you know that, but I mention it for any newbs who might read this.
Boyd
> On Sep 18, 2015, at 6:02 PM, Quincey Morris <email@hidden> wrote:
>
> On Sep 18, 2015, at 16:40 , Boyd Collier <email@hidden <mailto:email@hidden>> wrote:
>>
>> Any suggestions why this might be happening would be greatly appreciated.
>
> You should approach this systematically.
>
> 1. Is your app actually creating 2 window controllers? You can look at the object pointer in the debugger, and see if you had different objects each time.
>
> If there are multiple objects being created, are they being created serially (one being disposed of before the other is created), or in parallel (both created simultaneously)?
>
> 2. Is your app creating 2 documents?
>
> 3. If there is only 1 window controller object, you can start looking at various pieces of nib-loading API (e.g. windowDidLoad, viewDidLoad, that sort of thing) to find out you’re instantiating a nib twice, or triggering the same machinery twice in the loading of a single nib.
>
> Also, keep in mind that it’s not impossible that Cocoa is creating an extra document or window controller for its own purposes (e.g. as part of state restoration, or file versioning, or something newer like handoff). This *might* be the price of doing business, or it *might* indicate a problem in a different area of your app that it’s not obvious you should look at.
>
_______________________________________________
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