游戏中心排行榜在iOS 6 iPhone上查看错误的方向

时间:2013-08-12 19:26:48

标签: ios objective-c

我的应用程序仅支持横向,我只在iOS6的iPhone上遇到问题,其中游戏中心排行榜的方向错误,部分偏离屏幕。见附件:enter image description here

我正在使用这样的FPPopover从我的视图控制器调用模态UITableView:

HighScoresController *controller = [[HighScoresController alloc] init];
FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller];
popover.arrowDirection = FPPopoverNoArrow;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    popover.contentSize = CGSizeMake(350,450);
else
    popover.contentSize = CGSizeMake(350,350);
popover.delegate = self;
popover.title = @"High Scores";
[popover presentPopoverFromPoint: CGPointMake(mainView.center.x, self.view.center.y + 50)];

然后当在此表上单击其中一行时,它会在Game Center中调用相应的排行榜:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// authenticate into game center
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
    if (error ==nil) {
        GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
        if (leaderboardController != nil)
        {
            leaderboardController.leaderboardDelegate = self;
            leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;
            leaderboardController.category = [leaderboardIDs objectAtIndex:[indexPath row]];
            [self presentViewController: leaderboardController animated: YES completion:nil];
        }
    } else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Game Center"
                                                        message:@"You need to sign into Game Center in order to view high scores" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
        [alert show];
    }

}];
}

有关如何解决此问题的任何想法?它适用于iOS 5和iPhone,以及iOS 5和6的iPad。

谢谢!

0 个答案:

没有答案