0

我正在制作一个 iPhone 应用程序,但出现“预期标识符”错误。在错误日志中,上面有一个粗体的“解析问题”。它在这段代码中:

-(void) showLeaderboard:{
GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];

if (leaderboardController != nil)
{
    leaderboardController.leaderboardDelegate = self;
    [self presentModalViewController: leaderboardController animated: YES];  }}
-(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
[self dismissModalViewControllerAnimated:YES];

}

实际的错误就在这行:"-(void) showLeaderboard:{" 并且小指针在小括号上。请帮忙。谢谢。

4

1 回答 1

1

从方法中删除:。它应该只说-(void) showLeaderboard {

于 2012-08-22T17:08:02.117 回答