Re: swift: windowControllerDidLoadNib called twice
Re: swift: windowControllerDidLoadNib called twice
- Subject: Re: swift: windowControllerDidLoadNib called twice
- From: Quincey Morris <email@hidden>
- Date: Sat, 19 Sep 2015 01:02:56 +0000
On Sep 18, 2015, at 16:40 , Boyd Collier <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