'Receiver has no segue with identifier' when identifier exists

北城余情 提交于 2019-11-30 15:47:25

You should not instantiate your view controller this way:

GameClass *myNewVC = [[GameClass alloc] init];

Instead, use

 [[UIStoryboard storyboardWithName:@"storyboard name" bundle:nil] instantiateViewControllerWithIdentifier:@"vc identifier">]

Edit: Take a look at https://github.com/mac-cain13/R.swift

It will allow you to instantiate it easily with autocompletion, type safe method: R.storyboard.main.myViewController

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