2010-07-27 99 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]; 
} 

瞧,这是我的解决方案....