NSInvalidArgumentException reason Receiver has no segue with identifier

后端 未结 4 2137
说谎
说谎 2021-02-07 20:18

I have problem I\'ve been sitting with. I have a UIViewController List and a UIViewController Login. On Login I have a button \"Done\", al

4条回答
  •  情深已故
    2021-02-07 20:45

    As far as your code snippet goes, it looks like you tried to create a singleton out of the Login Controller, but only did it half way.

    The seque can't be found because the the Controller was initialized using the storyboard, not using your shared class method. So you end up having two independent instances. Additionally, your class method does not initialize the controller with the storyboard bindings, so you don't have any seques here.

    You should try to hand a reference of the LoginController's instance (initialized unsing storyboard segues etc.) to the 'other class' and use that one.

提交回复
热议问题