2010-07-27 98 views
0

我在我的應用程序下面的層次結構:的UIImagePickerController源(攝像機)顯示黑屏

UINavigationController 
    |__ UITabBarController 
      |__ UINavigationController 
        |__ ViewProfilePhotoController (*presentModalViewController:picker is done here) 

我的問題是,當我按下取消和罷免我的UIImagePickerController在ViewProfilePhotoController我得到一個僅帶有狀態欄的空白屏幕,而不是ViewProfilePhotoController(實際照片)中顯示的視圖。

這種行爲是非常奇怪的,因爲我試圖從我的應用程序層次取出的UITabBarController相同的代碼。這個問題是不存在的,一切按預期工作。相信我所有的委託在ViewProfilePhotoController中正確配置,並且我試圖修復它幾個小時。

我也檢查所有可能的配置內的UIImagePickerController,通過制定正確的父視圖,迄今沒有奏效。

我也試圖妥善級聯 - viewWillAppear中 - viewWillDisappear下來的層次,仍然沒有運氣。

任何有識之士將不勝感激。感謝名單

回答

0

OK所以很多很多小時後,我的記錄找到的解決方法。

In my rootController UINavigationController I was adding 2 UIViewControllers to the navigation stack and then after the authentication happened I did the following to add my UITabBarController:

[self.navigationController initWithRootViewController:theTabController]; 

我被添加UITabController如在第二UIViewController中的RootViewController的和的UIImagePickerController不喜歡此,並且當在導航隨後添加以後。它將被解僱,留下一個白色的屏幕。

相反。我打電話給我的籌碼,雖然我的appDelegate根的UIViewController,並添加的UITabBarController這樣的:

- (void) authSucceded { 

     [self createTabBarController]; 

     self.theTabController.view.tag = 2345; 
     [self.view addSubview:self.theTabController.view]; 
} 

瞧,這是我的解決方案....