instantiateViewControllerWithIdentifier - Storyboard id set but still not working

后端 未结 6 1008
抹茶落季
抹茶落季 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:55

    try this Storyboard Choose UIViewController-> Xcode->Editor->Emabed In->Navigation Controller

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"YourStoryboard"
                                                             bundle: nil];
    
    YourViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"YourViewController"];
    [self.navigationController pushViewController:vc animated:YES];
    

提交回复
热议问题