我已经看过了所有关于这本书的教程,但仍然没有答案.我需要调用代码中的另一个视图.我用UIStoryboards
.我已经通过从UIButtons
拖动控件多次更改了视图,但现在它必须来自代码.如果用户是第一次打开应用程序,我会try 从主菜单调用信息页面.然而,我似乎找不到改变代码视图的方法.我的所有视图都由相同的文件控制(ViewController2).我主菜单的identifier
是ViewControllerMain,信息页面的identifier
是ViewControllerInfo.首先我试了一下:
[ViewControllerMain presentViewController: ViewControllerInfo
animated:YES
completion: NULL];
然后我试着 for each 人做不同的UIViewControllers
,然后说:
[ViewController2 presentViewController: ViewController
animated:YES
completion: NULL];
两个都不管用.对于第一个,它说:
使用未声明的标识符ViewControllerMain.
在第二条中,它说:
意外的接口名称"ViewController":应为标识符.
我能做什么?