2012-04-11 66 views
0

所以我有我的應用程序運行iPad的主 - 細節項目。只有景觀UIView轉向肖像

我添加了一個UIBarButtonItem該節目推送一個視圖「關於應用程序」的細節。

當我將第三個視圖按下細節(從UITable)並點擊後退按鈕時,它會返回導航控件堆棧上的第二個視圖,然後視圖變爲肖像!

我所有的viewControllers有以下代碼:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
     return UIInterfaceOrientationIsPortrait(interfaceOrientation); 
    else 
     return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 

這是出現錯誤:

視圖控制器從-shouldAutorotateToInterfaceOrientation沒有返回 :所有接口 方向。它應該至少支持一種方向。

我也嘗試直接從Storyboard設置UIView方向上的橫向,但也不起作用。

任何線索?

+0

與我意識到,我的關於故事板視圖類並沒有指着我AboutViewController等問題的幾個測試後.m類。對於這個愚蠢的問題抱歉。 – 2012-04-11 05:34:05

回答

0

一段時間,我意識到,我的第三個觀點有一個稍微不同的代碼之後。

我剛纔複製的代碼形式的其他意見,並粘貼在第三和它的工作現在...

0

我會嘗試刪除if語句來進一步檢查問題的原因,並只保留在isLandscape檢查。