我仍在使用 iOS 5 SDK 和 Xcode 4.2 (Snow Leopard)。我正在将 Game Center 添加到我的游戏中,当它通过身份验证时,每当我尝试使用此代码(来自 Apple)显示排行榜时,我都会收到 ARC 错误:
- (void) showLeaderboard: (NSString*) leaderboardID
{
GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
if (leaderboardController != nil)
{
**leaderboardController.leaderboardDelegate = self;**
leaderboardController.timeScope = GKLeaderboardTimeScopeToday;
leaderboardController.category = leaderboardID;
[self presentViewController: leaderboardController animated: YES completion:nil];
}
}
我收到此错误:
Passing "ViewController *const__strong' to parameter of incompatible type 'id <GKLeaderboardViewControllerDelegate>"
除了在 Lion 上使用 iOS 6 SDK 之外,还有其他解决方案吗?
谢谢!