2012-03-26 3 views
0

私は自分のアプリに "Master-detail application"というモデルを使用しており、異なる初期表示を設定したいと考えています。出来ますか?私は、メニューボタンでUIViewControllerを表示したいと思います。これらのボタンの1つは、前の元の初期ビューのナビゲーションコントローラをロードする必要があります。既存のCOreDataアプリケーションに初期UIViewControllerを追加するにはどうすればよいですか?

私はstoryBoards UIの初期ビューをViewControllerに変更し、ボタンをNavigationControllerにリンクすると、アプリケーションがクラッシュします。

正しいことは何でしょうか?

ありがとうございました!

-(IBAction)flipToMaster:(id)sender{ 
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 
[appDelegate tellDelegateToFlip];    
}  

すれば完了です:マスター・ビューを呼び出すために

- (void)tellDelegateToFlip{ 
MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 
    masterViewController.managedObjectContext = self.managedObjectContext; 

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.4]; 
[UIView setAnimationTransition:UIViewAnimationOptionTransitionFlipFromLeft forView:self.window cache:YES]; 

[self.navigationController pushViewController:masterViewController animated:YES]; 
[UIView commitAnimations]; 
}  

、初期表示するには、この方法:

+0

アプリがクラッシュしたときにはどのようなエラーが発生しますか?それは完全に可能でなければなりません! – deanWombourne

答えて

0

はAppDelegateにこのコードを含めます!

関連する問題