Every time I submit an achievement to Game Center on macOS, using Mac Catalyst, my game crashes with this:
No call stack. I set a break point for all the Obj-C exceptions but it's just stopped in the AppDelegate.
Everything is fine on iOS and iPadOS, and the rest of the Game Center behaviour on macOS seems to be fine.
For reference, this is how I submit the achievements:
That function uses these data structures:
Also, how can I reset the achievements for one user? Because in order to debug this I already run out of chances... I need to keep creating new users in order to test the completion banner, since it's shown only once.
Code Block -[GKAchievementInternal showBanner]: unrecognized selector sent to instance 0x600002616ca0
No call stack. I set a break point for all the Obj-C exceptions but it's just stopped in the AppDelegate.
Everything is fine on iOS and iPadOS, and the rest of the Game Center behaviour on macOS seems to be fine.
For reference, this is how I submit the achievements:
Code Block swift private func submitAchievements(_ aList: [Achievement]) { if !isGameCenterEnabled { return } var achievements : [GKAchievement] = [] for kvp in AchievementFromId { if aList.contains(kvp.1) { let achievement = GKAchievement(identifier: kvp.0) achievement.showsCompletionBanner = true achievement.percentComplete = 100.0 achievements.append(achievement) } } if achievements.count > 0 { GKAchievement.report(achievements, withCompletionHandler: { (error: Error?) -> Void in if let err = error { NSLog("submitAchievements: \(err.localizedDescription)") } }) } }
That function uses these data structures:
Code Block swift enum Achievement : Int { case clearTutorial = 0x00000001, clearLevel1 = 0x00000002, clearLevel2 = 0x00000004, } let AchievementFromId : [String : Achievement] = [ "Tutorial": .clearTutorial, "Level1": .clearLevel1, "Level2": .clearLevel2, ]
Also, how can I reset the achievements for one user? Because in order to debug this I already run out of chances... I need to keep creating new users in order to test the completion banner, since it's shown only once.