我正在使用自定义UIWindow编写iPhone应用程序。(xCode6.1,iOS8.1)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;
CGRect bounds = [[UIScreen mainScreen] bounds];
_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, bounds.size.height, bounds.size.width)];
[_window setBackgroundColor:[UIColor greenColor]];
[_window makeKeyAndVisible];
return YES;
}
它仅针对iPhone,仅限景观。所有iPhone设备都可以正常工作,但是当它在iPad上运行时,UIWindow框架就会崩溃。
有什么建议吗?