Cocoa View Controller Scene issue

萝らか妹 提交于 2020-01-16 12:22:08

问题


I have 2 View Controller Scenes. Scene2 holds settings that will be used in scene1. Scene2 is accessed by menu item and its presented as show.

Now the issue is that the settings used in scene2 will not be used by scene1 unless the latter is refreshed.

I did try to trigger a viewDidLoad() of scene1 when the settings were saved at scene2 but it crashed.

   class replaceSegue: NSStoryboardSegue {


    override func perform() {
        if let fromViewController = sourceController as? NSViewController {
            if let toViewController = destinationController as? NSViewController {
                // no animation.
                fromViewController.view.window?.contentViewController = toViewController
            }
        }
    }
   }

来源:https://stackoverflow.com/questions/38734559/cocoa-view-controller-scene-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!