Chapter 32: Window variable is now in Scene rather than app delegate file

Hi @ganem, hi @shogunkaramazov,
any progress on the official fix? Or shall I go along with the solution @interactivexr posted?
Thanks for the info!

I’ve deleted SceneDelegate.swift, and removed reference to Scene in Info.plist and it worked. It is the same as in the source code now.

Hi @interactivexr,
Thanks for your help so far. Your solution worked for the first part.
But as mentioned bei @saipurva, the “window” problem will come back in the next chapter.
Maybe @saipurva can also explain to me how to solve that problem since you fixed it :slight_smile:

But I run into the same error of course, since the window object still does not exist in AppDelegate.swift…

Bildschirmfoto 2020-05-01 um 12.40.40

Please help!
Thanks!

Where did you remove the reference to Scene in Info.plist?
When I do this I still run into the error, that window = nil. How did you get rid of that?
Thanks for your help!

the line of let tabcontroller, i actually removed it and the following one. it worked for me.
sorry for the late reply

Thanks for your reply!
That is not a solution at all, the app will just get stuck after clicking done, without giving the error message…

Thanks everyone for flagging this and for trying to help.
I can confirm that since iOS 13 the new logic should be inside SceneDelegate.swift.
That has been fixed in the newest version of the book.

Thanks for your reply @ganem. Can you please let me know where to put the call for method listenForFatalCoreDataNotifications() exactly?
Thanks!
Also, when will the new version be available?

The entire content of application(_:didFinishLaunchingWithOptions:) should move to scene(_:willConnectToSession:options:)

The updated version should be published in about a few weeks.

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.