저는 코드에서 GKChallengeListener를 구현하려고하는데 apple에서 GameCenterManager 클래스를 사용했습니다. 플레이어는 훌륭한 인증을 받았으며 리더 보드와 도전 과제도 있습니다. But i want to notify my application when the remote player completed the challenge. for this i have used GKChallengeListener protocols. but they are not calling up when i am sending or receiving the challenges
에서 참조하십시오. 하지만 이것은에 감가 상각어떤 클래스가 GKLocalPlayerListener 프로토콜을 구현하는 데 사용됩니까
@implementation ViewController
@synthesize gameCenterManager;
@synthesize currentScore;
@synthesize currentLeaderBoard;
@synthesize currentScoreLabel;
- (void)viewDidLoad
{
[super viewDidLoad];
self.currentLeaderBoard = kLeaderboardID;
self.currentScore = 0;
if ([GameCenterManager isGameCenterAvailable]) {
self.gameCenterManager = [[GameCenterManager alloc] init];
[self.gameCenterManager setDelegate:self];
[self.gameCenterManager authenticateLocalUser];
} else {
// The current device does not support Game Center.
}
}
-(void)player:(GKPlayer *)player issuedChallengeWasCompleted:(GKChallenge *)challenge byFriend:(GKPlayer *)friendPlayer{
NSLog(@"issued challenge was completed by friend");
}
-(void)player:(GKPlayer *)player didCompleteChallenge:(GKChallenge *)challenge issuedByFriend:(GKPlayer *)friendPlayer{
NSLog(@"player did complete challenge");
}
-(void)player:(GKPlayer *)player didReceiveChallenge:(GKChallenge *)challenge{
NSLog(@"player did recieve challenge");
}
-(void)player:(GKPlayer *)player wantsToPlayChallenge:(GKChallenge *)challenge{
NSLog(@"player wants to play challenge ");
}
만약 당신이 downvote 의견을 추가하십시오 – iOS