解析问题预期标识符

时间:2012-08-22 16:52:15

标签: iphone ios xcode gamekit void

我正在制作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:{”并且小指针位于小括号上。请帮忙。感谢。

1 个答案:

答案 0 :(得分:1)

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