Objective c UIApplication(UIU首选面向接口的IvenCurrenoOrientation:SIGABRT)

Objective c UIApplication(UIU首选面向接口的IvenCurrenoOrientation:SIGABRT),objective-c,ios,sigabrt,autorotate,crash-log,Objective C,Ios,Sigabrt,Autorotate,Crash Log,我的应用程序在启动时继续崩溃,并出现以下奇怪错误:-[UIApplication\u preferredinterfaceorientationgivencurrentoorientation:]:无法识别的选择器发送到实例0x23b5f0。\u preferredinterfaceorientationgivencurrentoorientation方法是为自动旋转逻辑调用的,所以我去掉了所有提到的 - (BOOL)shouldAutorotateToInterfaceOrientation:

我的应用程序在启动时继续崩溃,并出现以下奇怪错误:
-[UIApplication\u preferredinterfaceorientationgivencurrentoorientation:]:无法识别的选择器发送到实例0x23b5f0
\u preferredinterfaceorientationgivencurrentoorientation
方法是为自动旋转逻辑调用的,所以我去掉了所有提到的

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
并清理了目标和构建文件夹,但它一直记录异常。有人遇到过这个奇怪的错误吗?有人修复了吗

事故日志:

2011-11-05 17:14:17.369 AppName[1542:707] -[UIApplication _preferredInterfaceOrientationGivenCurrentOrientation:]: unrecognized selector sent to instance 0x23b5f0
2011-11-05 17:14:17.375 AppName[1542:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIApplication _preferredInterfaceOrientationGivenCurrentOrientation:]: unrecognized selector sent to instance 0x23b5f0'
*** First throw call stack:
(0x36da28bf 0x321121e5 0x36da5acb 0x36da4945 0x36cff680 0x31b35b7d 0x338532f9 0x33852e33 0x31b3be2d 0x3382cf19 0x36d01803 0x36d02491 0x31bee4bf 0x31befbb9 0x31b28a45 0x319b2227 0x319ac313 0x3197a921 0x3197a3bf 0x31979d2d 0x329d4e13 0x36d76553 0x36d764f5 0x36d75343 0x36cf84dd 0x36cf83a5 0x319ab457 0x319a8743 0x2cbb 0x2c60)
terminate called throwing an exceptionkill
quit
Program ended with exit code: 0 
编辑1:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //add the scroll view to our main window    
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    viewController = [[[ViewController alloc] initWithNibName:@"MainWindow" bundle:[NSBundle mainBundle]] autorelease];
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];

    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];    

    splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
    splashView.image = [UIImage imageNamed:@"Default.png"];
    [window addSubview:splashView];
    [window bringSubviewToFront:splashView];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:2.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
    [UIView setAnimationDelegate:self]; 
    [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
    splashView.alpha = 0.0;
    splashView.frame = CGRectMake(-67, -95, 492, 710);
    [UIView commitAnimations];

    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    [[NSUserDefaults standardUserDefaults] setObject:version forKey:@"version_preference"];

    return YES;   
}

你的appDelegate中有这样一行代码吗

self.window.rootViewController = [UIApplication sharedApplication];

当UIViewController之间出现转换时,将在引擎盖下调用此方法
\u preferredinterfaceorientationgivencurrendooritation
。您的
ui应用程序
是消息接收器,这意味着您已将其铸造为应用程序中的某个视图控制器或类似的东西。

测试。。。听起来不错。我将发布我当前的-(BOOL)应用程序:(UIApplication*)应用程序didfishlaunchingwithoptions:(NSDictionary*)launchOptions方法。请务必查看源代码的splashView部分。它为启动屏幕提供了一个非常酷的过渡。