飞溅在iPad上后的空白屏幕

问题描述:

一位用户发送了一封电子邮件,说当启动一个ipad应用程序时,他看到启动画面,并且statusBar变得可见,之后只有空白屏幕。所以他无法继续使用应用程序。用户使用iOS 5.1.1的iPad3。我测试了所有可能的iOS版本和不同的使用场景,但无法重现这种情况。有任何想法吗?飞溅在iPad上后的空白屏幕

启动代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
[[UIApplication sharedApplication] setStatusBarHidden:NO]; 
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque]; 

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) 
{ 
    self.window.rootViewController = padMainNavigationController; 
} 
else 
{ 
    self.window.rootViewController = self.tabBarController; 
} 
NSError *sessionError = nil; 
[[AVAudioSession sharedInstance] setDelegate:self]; 
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&sessionError]; 

// 2. Changing the default output audio route 
UInt32 doChangeDefaultRoute = 1; 
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &doChangeDefaultRoute); 
[self.window makeKeyAndVisible]; 
int cacheSizeMemory = 4*1024*1024; // 4MB 
int cacheSizeDisk = 60*1024*1024; // 60MB 
NSURLCache *sharedCache = [[[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"] autorelease]; 
[NSURLCache setSharedURLCache:sharedCache]; 

return YES; 
} 
+0

其中padMainNavigationController实例化? – CSmith 2012-08-15 14:18:51

+0

它在界面构建器中连接。 – 2012-08-15 14:26:24

+2

空白屏幕表示padMainNavigationController为零,或没有连接到它的视图 – CSmith 2012-08-15 14:31:39

White Screen using navigationController - 它解决了我的问题,这是类似于在OP被描述。