ios - Game Center authentication always results in sigabrt -


this driving me crazy. every time try authenticate local player game center thread-1 sigkill. happens asynchronously after set localplayer's authenticatehandler so:

- (void)authenticatelocalplayer {     if([[[uidevice currentdevice] systemversion] floatvalue] >= 6.0)     {         gklocalplayer __weak *localplayer = [gklocalplayer localplayer];         localplayer.authenticatehandler = ^(uiviewcontroller *viewcontroller, nserror *error)         {             if (viewcontroller != nil)             {                 [[[[[uiapplication sharedapplication] delegate] window] rootviewcontroller] presentviewcontroller:viewcontroller animated:yes completion:nil];             }             else if (localplayer.isauthenticated)             {                 nslog(@"player authenticated");             }             else             {                 nslog(@"player authentication failed");             }         };     } } 

any ideas?

i've seen systemversion tested string comparison instead of number comparison. try printing value of

[[[uidevice currentdevice] systemversion] floatvalue] >= 6.0

to verify there's nothing wrong expression. know following method works:

-(bool) os6 {     nsstring *targetsystemversion = @"6.0";     nsstring *currentsystemversion = [[uidevice currentdevice] systemversion];     if ([currentsystemversion compare:targetsystemversion options:nsnumericsearch] == nsorderedascending) {         return no;  //current system version less 6.0     } else {         return yes;     } } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -