objective c - Authenticate player ios app -



objective c - Authenticate player ios app -

i trying integrate game center app, maintain getting errors. input next code app delegate.m , get:

- (void)authenticatelocalplayer { gklocalplayer *localplayer = [gklocalplayer localplayer]; localplayer.authenticatehandler = ^(uiviewcontroller *viewcontroller, nserror *error){ if (viewcontroller != nil) { [self presentviewcontroller:viewcontroller animated:yes completion:nil]; } else{ if ([gklocalplayer localplayer].authenticated) { _gamecentermanager = yes; // default leaderboard identifier. [[gklocalplayer localplayer] loaddefaultleaderboardidentifierwithcompletionhandler:^(nsstring *leaderboardidentifier, nserror *error) { if (error != nil) { nslog(@"%@", [error localizeddescription]); } else{ leaderboardidentifier = leaderboardidentifier; } }]; } else{ _gamecentermanager = no; } } };

}

i utilize code, error part of code:

[self presentviewcontroller:viewcontroller animated:yes completion:nil];

xcode tells me instance method not found. understanding instance method uiview? there anyway somehow utilize method in app delegate class?

in add-on @raptor's reply seek following.

[self.window.rootviewcontroller presentviewcontroller:viewcontroller animated:yes completion:nil];

ios objective-c xcode game-center

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -