2014-12-05 75 views
1

我得到這樣的警告的警告消息:爲什麼我得到我的日誌,內容是我的UINavigationController是不是在窗口層次

Warning: Attempt to present <UINavigationController: 0x137e1ff80> on <HomePageViewController: 0x137e0ae30> whose view is not in the window hierarchy! 

我試圖頂模從我HomePageViewController我CreatePageViewController ...只是一個簡單的賽格。

HomePageViewController.m:

- (IBAction)goToCreate:(id)sender { 
    [self performSegueWithIdentifier:@"createModal" sender:self]; 
} 

和我創建的自定義模態來與CreatePageViewController稱爲 「createModal」 的標識符,我在一個UINavigationController嵌入CreatePageViewController。

爲什麼你覺得我得到這個警告..?

回答

0

出錯了故事板,試圖從代碼啓動: 設置爲CreatePageViewController在故事板「故事板ID」,然後使用此代碼:

CreatePageViewController *CreateVC = [self.storyboard instantiateViewControllerWithIdentifier:@"*here storyboard id*"]; 
[self presentViewController:CreateVC animated:YES completion:nil]; 

如果這是確定,那麼在UINavigation層次問題。

相關問題