instantiateViewControllerWithIdentifier - Storyboard id set but still not working

后端 未结 6 989
抹茶落季
抹茶落季 2020-12-10 01:18

I have to created a segue programmatically however when I click on the button the view controller does not change to the next, Storyboard ID is set and still not working. Am

6条回答
  •  不思量自难忘°
    2020-12-10 01:52

    You can't set the view controllers storyboard. It's read only and set when the view controller is created. Instead, you will need to get the storyboard from somewhere else or load it.

    You could get the storyboard from the AppDelegate's root view controller. Or use + (UIStoryboard *)storyboardWithName:(NSString *)name bundle:(NSBundle *)storyboardBundleOrNil.

提交回复
热议问题