Ios 无法从精灵套件打开游戏中心

Ios 无法从精灵套件打开游戏中心,ios,objective-c,xcode,uiviewcontroller,sprite-kit,Ios,Objective C,Xcode,Uiviewcontroller,Sprite Kit,我想从我的Sprite Kit类打开Game Center排行榜页面,但我一直遇到以下错误: 2014-09-13 14:24:52.183 SpriteTest[6733:77452]-[UIView setIgnoresSiblingOrder:]: unrecognized selector sent to instance 0x7f89cf078fd0 2014-09-13 14:24:52.218 SpriteTest[6733:77452] *** Terminating ap

我想从我的Sprite Kit类打开Game Center排行榜页面,但我一直遇到以下错误:

2014-09-13 14:24:52.183 SpriteTest[6733:77452]-[UIView setIgnoresSiblingOrder:]:   
unrecognized selector sent to instance 0x7f89cf078fd0
2014-09-13 14:24:52.218 SpriteTest[6733:77452] *** Terminating app due to 
uncaught exception 'NSInvalidArgumentException', reason: '-[UIView 
setIgnoresSiblingOrder:]: unrecognized selector sent to instance 0x7f89cf078fd0'
这就是我试图打开SKScene课程排行榜的方式:

- (void)openGameCenter{
    if ([GKLocalPlayer localPlayer].isAuthenticated) {
        GKGameCenterViewController *leaderboardController = [[GKGameCenterViewController alloc] init];
        leaderboardController.gameCenterDelegate = self;
        leaderboardController.viewState = GKGameCenterViewControllerStateLeaderboards;
        UIViewController *vc = [[GameViewController alloc] init];
        [vc presentViewController: leaderboardController animated: YES completion:nil];
    }else{
        UIAlertView *alert = [[UIAlertView alloc]initWithTitle: @"Error"
            message: @"You must be logged into Game Center to view the leaderboards. Open Game Center?"
            delegate: self
            cancelButtonTitle:@"No"
            otherButtonTitles:@"Yes",nil];
        [alert show];
    }
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]];
    }
}

GameViewController是显示此sprite工具包的ViewController。

引发异常是因为您正在向UIView实例而不是其子类SKView发送消息。SKView理解
setIgnoresSiblingOrder:
,但UIView不理解


尝试此解决方案:

错误与您发布的代码无关。