Segue from xib to storyboard objective-C



假设故事板中有2个uiviewcontroller,说'A'和'B'。此外,还有一个xib文件,例如'C',其中包含。h和。m文件。'A'访问C的一个方法它在A的视图上添加了自己的视图。C也有一个方法做[self。]视图removeFromSuperView]。我想做的是在C的视图被移除后,我想segue到b

注意:我没有在我的实现中使用导航视图控制器。

到目前为止我所尝试的('poi'下面是B的storyboard ID):

[self dismissViewControllerAnimated:YES completion:nil];
[self.view removeFromSuperview];
UIStoryboard * myStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
B *chartpage = [myStoryboard instantiateViewControllerWithIdentifier:@"poi"];
[self presentModalViewController:chartpage animated:YES];

警告:"不鼓励在分离的视图控制器上呈现视图控制器"而且,'presentModalViewController'方法已弃用。

尝试调用window的rootViewController的presentViewController:animated:completion:方法

最新更新