欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

笔记:载入viewcontroller的几种方式

程序员文章站 2022-05-07 23:45:15
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControlle... ......
uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil];
uiviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier:@"identifier"];
[self.navigationcontroller pushviewcontroller:vc animated:yes];


uiviewcontroller *vc = [[uiviewcontroller alloc] initwithnibname:@"nibname" bundle:nil];
[self.navigationcontroller pushviewcontroller:vc animated:yes];

uiviewcontroller *vc = [[uiviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:vc animated:yes];