2012-02-24 135 views
0

我創建了一個拆分視圖項目,在iPhone的故事板上,我將一個欄按鈕項目拖到導航右側並更改樣式添加,然後將視圖控制器拖到故事板,所以我使用控制拖動來建立鏈接,並更改uiviewcontroller的自定義類「AddViewController」,當我運行該項目並推動DetailViewController時,它是黑色的視圖。故事板導航項目鏈接到UI控制器

,我已經輸入的代碼在AddViewController.m

-(void) viewDidAppear:(BOOL)animated 
{ 
    [super viewDidAppear:animated]; 
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"  bundle:nil]; 
    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"AddViewController"]; 
    [vc setModalPresentationStyle:UIModalPresentationCurrentContext]; 
    [self presentModalViewController:vc animated:YES]; 
} 

回答

0

我找到了原因 在我的創造「AddCreateViewController」,我要發表評論的功能。

- (void)loadView 
{ 
    // If you create your views manually, you MUST override this method and use it to create your views. 
    // If you use Interface Builder to create your views, then you must NOT override this method. 
} 
相關問題