获得ViewController对象

iOS5中用storyboard,在AppDelegate中获得ViewController对象的方法记录:

1 UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil];
2 self.viewController = (ViewController* )[mainStoryboard instantiateViewControllerWithIdentifier: @"LoginViewController"];

然后在viewController中设置identifier就可以了。

posted @ 2012-12-23 16:10  阿兹猫  阅读(140)  评论(0编辑  收藏  举报