在iPad上飞溅后的空白屏幕

时间:2012-08-15 14:08:35

标签: objective-c ios ipad ios5

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

启动代码:

- (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;
}

1 个答案:

答案 0 :(得分:1)

White Screen using navigationController - 它解决了我的问题,这与OP中描述的类似。