Game center player authentication issue

I’m integrating Game Center into my app and when I try to authenticate the player I get a crash in the game on the simulator, but on the device it works fine.

When I call this line…

[localPlayer authenticateWithCompletionHandler:^(NSError *error) {

On the simulator it asks me to sign into sandbox gamecenter or create an account. If I sign in or create an account the game crashes with “EXC_BAD_ACCESS”

Running the game on a device works fine. I can log in and it shows the welcome message. Anyone have any information on how to fix this? Been searching google for 2 hours :frowning:

Can you show the source code as you have mixed Obj-C and C++?

You can combine Obj-C and C*+ in one file by changing the file extension to .mm. Then you can do stuff like this…
<pre>
void AuthenticatePlayer
{
;
;
}
}
</pre>
Then you can call AuthenticatePlayer from any c*+ file, assuming you declare it in the header. Does that make sense? I can give you more details if you still can’t get it.

Thanks for your help