2014年2月13日木曜日

ios UINavigationbarでStoryBoard内のViewContorollerにコードで遷移する方法

ios UINavigationbarでStoryBoard内のViewContorollerにコードで遷移する方法


状況は、ストーリーボード上に置いた、ビューコントローラーにNavigationController
を使って遷移したい状況。


まずは、遷移したいビューコントローラーに対して、identity Insectorから、
Story Board Idを入力する。



そして、遷移したい場所でコードを書く

// 任意のビュー
NextView *con = [self.storyboard instantiateViewControllerWithIdentifier:@"NextView"];
        
// 任意のViewControllerに遷移する
[self.navigationController pushViewController:con animated:YES];

以上です。

0 件のコメント:

コメントを投稿