viewDidLoad called before prepareForSegue finishes

前端 未结 5 633
梦毁少年i
梦毁少年i 2020-12-24 12:46

I was under the impression that viewDidLoad will be called AFTER prepareForSegue finishes. This is even how Hegarty teaches his Stanford class (as recently as Feb 2013).

5条回答
  •  梦谈多话
    2020-12-24 13:16

    I had a similar problem with my dynamic cell which showed a modal when selected. prepareForSegue was executed before didSelect:atIndexPath. What helped me was that in the storyboard I reassigned the segue to start from the controller and not the dynamic cell prototype. I solved the race condition (?) and everything is working perfectly!

提交回复
热议问题