【发布时间】:2014-04-18 20:29:39
【问题描述】:
我正在尝试使用此代码在我的情节提要中实例化一个新的视图控制器,但它什么也不做,并且停留在旧情节提要上。
代码如下:
(void)menuSelect:(id)sender {
UIButton *button = (UIButton*) sender;
switch (button.tag) {
case 0: {
HomeViewController *hc=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"Home"];
[self presentViewController:hc animated:YES completion:nil];
break;
}
故事板文件名为 Main.Storyboard,viewController 的 id 为 Profile。
这是故事板的样子:
【问题讨论】:
标签: ios iphone objective-c xcode storyboard