[英]How do I make the default value 0 with GameKit
let localPlayerScore = request.localPlayerScore ?? 0
The problem is that Swift is expecting the 0 to be of type GKScore
.问题是 Swift 期望 0 是
GKScore
类型。
I get the following error:我收到以下错误:
Cannot convert value of type 'Int' to expected argument type 'GKScore'
无法将“Int”类型的值转换为预期的参数类型“GKScore”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.