`
java-mans
  • 浏览: 11391591 次
文章分类
社区版块
存档分类
最新评论

ios5 storyboard 代码获取独立的 viewController对象

 
阅读更多

//1.storyboard中定义某个独立newViewController(无segue跳转关系)的 identifier

static NSString *controllerId =@"newViewController";


//2.获取UIStoryboard对象

UIStoryboard *story = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

//3.从storyboard取得newViewCtroller对象,通过Identifier区分

newViewController *nvc = [storyinstantiateViewControllerWithIdentifier:controllerId];

//4.对newViewController进行压栈实现tableview跳转到newTableview

[ [selfnavigationController]pushViewController:nvc animated:YES ];

if([selfnavigationController] != nil)

NSLog(@"self.navigationController is not nil");

else {

NSLog(@"self.navigationController is nil");

}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics