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 > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-06-2012, 09:29 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 1
nathanchunkie is on a distinguished road
Default Game center score not posting

Scores in game center wont add does anyone know what's wrong with it?

Counter = in the .header file ;

int counter;

And the .m file looks like;

Code:
  - (IBAction) subScore{
        
        GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"1234567"];
        scoreReporter.value = counter;
        
        [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
            if (error != nil)
            {
                NSLog(@"Failed: %i",counter);   
            } else {
                NSLog(@"Succes: %i",counter);  
                
                
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thanks" 
                                                                message:@"Score is added! Play again." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                
                [alert show];
    
                
            }
        }];
        
    }


The NSLogs is giving me the succes with a score.

**Is it possible to add a score to game center in sandbox mode?**


------

2;

I also tried;

Code:
  - (void) reportScore: (int64_t) counter forCategory: (NSString*) category
    {
        GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"1234567"];
        scoreReporter.value = counter;
        
        [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
            if (error != nil)
            {
                 NSLog(@"Failed: %lld", counter);   
            }
        }];
    }

This is giving me an error (crash);

Code:
> 2012-01-07 04:09:03.574 [1475:707] Succes (viewdidload) 14 2012-01-07
> 04:09:05.907 [1475:707] -[score subScore]: unrecognized selector sent
> to instance 0x1eddb0 2012-01-07 04:09:05.912 [1475:707] ***
> Terminating app due to uncaught exception
> 'NSInvalidArgumentException', reason: '-[score subScore]: unrecognized
> selector sent to instance 0x1eddb0'
> *** First throw call stack: (0x340188bf 0x342681e5 0x3401bacb 0x3401a945 0x33f75680 0x33f72435 0x373dc9eb 0x373dc9a7 0x373dc985
> 0x373dc6f5 0x373dd02d 0x373db50f 0x373daf01 0x373c14ed 0x373c0d2d
> 0x307f3df3 0x33fec553 0x33fec4f5 0x33feb343 0x33f6e4dd 0x33f6e3a5
> 0x307f2fcd 0x373ef743 0x29c1 0x2958) terminate called throwing an
> exception(gdb)

Last edited by nathanchunkie; 01-07-2012 at 12:13 AM. Reason: Game center score not posting
nathanchunkie is offline   Reply With Quote
Reply

Bookmarks

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: 497
13 members and 484 guests
AlanFloyd, andyzaharia, AppsBlogger, David-T, HemiMG, iAppDeveloper, imac74, Jaxen66, lovoyl, Paul Slocum, tiendung2992, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,684
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, tiendung2992
Powered by vBadvanced CMPS v3.1.0

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