Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-05-2011, 09:38 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 2
codyspraker is on a distinguished road
Default Game Center Does not recognize my game?

I have a fairly simple game which i am trying to incorporate game center into, i have seen videos and added the necessary code. However when i get the sign in box and enter my username and password it says that the game is not recognized by game center. When i try to submit a score the game crashes with a sigABRT error. I am sent to a blank leaderboard in game center when i try to access the leaderboard.


-(void) sendScore
{
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"1234567890"] autorelease];
scoreReporter.value = firstStoredScore;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if(error != nil)
{
NSLog(@"submit score Failed");
}
else
{
NSLog(@"submit score was successful!");
}
}];

}
-(void) showLeader
{
GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
if(leaderboardController != nil)
{

leaderboardController.leaderboardDelegate = self;
[self presentModalViewController:leaderboardController animated:YES];

}
}


-(void) leaderboardViewControllerDidFinish:(GKLeaderboardV iewController *)viewController
{

[self dismissModalViewControllerAnimated:YES];


}


- (void)viewDidLoad {
[super viewDidLoad];

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
if(error == nil)
{
NSLog(@"Authentication Successful!");

}

else
{
NSLog(@"Authentication failed");

}
}];

defaults = [NSUserDefaults standardUserDefaults];
[self update];

}
-(IBAction) submit: (id) sender
{
[self sendScore];
}

-(IBAction) showLeader: (id) sender
{
[self showLeader];
}

Last edited by codyspraker; 08-05-2011 at 09:40 AM. Reason: smiley appeared on accident in code
codyspraker is offline   Reply With Quote
Reply

Bookmarks

Tags
center, game, leaderboard, score, sigabrt

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 392
14 members and 378 guests
7twenty7, blasterbr, buggen, chiataytuday, dedeys78, dre, fiftysixty, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, pungs, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:04 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0