iOS Question GameCenter always crashes

sorex

Expert
Licensed User
Longtime User
Hello,

Follwing this tutorial > https://www.b4x.com/android/forum/threads/gamecenter.85766/#post-556404

I only seem to get crashes during the calls below...

B4X:
Dim sf As Object = Game.RequestScores("Board1")

Wait For (Game.SubmitScore(s)) GameCenter_ScoreSubmitted (Success As Boolean)

the log in always seems to work fine.

What I did...

I created a non-wildcart certificate, provisioning profile.
Created the leaderboard with the same ID as the tutorial screenshot (I removed the 'main' one mentioned in the other thread)
Enabled the gamecenter with the created leaderboard
I added the files to my add. libs folder and taged the iGameCenter 1.01 library

the only change in the source was the line of the #provisionprofile: and the build config package name.

I'm using the remote builder.

Error message on the requestscores call...

B4X:
Application_Start
Application_Active
Authenticated!
Error occurred on line: 58 (Main)
+[B4IObjectWrapper raiseEventFromDifferentThreadWithExplicitSender::::]: unrecognized selector sent to class 0x10b734
Stack Trace: (
  CoreFoundation       <redacted> + 150
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  CoreFoundation       <redacted> + 700
  CoreFoundation       _CF_forwarding_prep_0 + 24
  B4i Game             __31-[B4IGameCenter RequestScores:]_block_invoke + 442
  GameCenterFoundation <redacted> + 12
  libdispatch.dylib    <redacted> + 10
  libdispatch.dylib    <redacted> + 22
  libdispatch.dylib    <redacted> + 1524
 CoreFoundation       <redacted> + 8
 CoreFoundation       <redacted> + 1574
 CoreFoundation       CFRunLoopRunSpecific + 520
 CoreFoundation       CFRunLoopRunInMode + 108
 GraphicsServices     GSEventRunModal + 160
 UIKit                UIApplicationMain + 144
 B4i Game             main + 106
 libdyld.dylib        <redacted> + 2
)
SignalHandler 6

leaderboard.gif
 

sorex

Expert
Licensed User
Longtime User
I think the update solved it.

on this iphone 5(s?) it works fine.

I'll test it on the 4S which is at work tomorrow.

Thanks!
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I confirm that it also works on the 4S at work.

can you just tell how many scores the requestscores pulls in?
hopefully not everything but just the top 10 or so?
 
Upvote 0
Top