[英]How can I update user's score in Firebase using Swift?
I have a game. 我有游戏 Every user creates an account.
每个用户都创建一个帐户。 Next, after finishing a game, his score suppose to save in a firebase.
接下来,在完成游戏后,他的比分应该保存在火力中。
Console gives me an error: "*** Terminating app due to uncaught exception 'InvalidPathValidation', reason: '(child:) Must be a non-empty string and not contain '.' 控制台给我一个错误:“ ***由于未捕获的异常'InvalidPathValidation'而终止应用程序,原因:'((child :)必须为非空字符串,并且不包含'。' '#' '$' '[' or ']''"
'#''$''['或']''“
You are trying to submit passedInt, integer which is nil and that's why you're getting this error. 您正在尝试提交passInt,它是nil的整数,这就是为什么出现此错误的原因。 Try to assign a value to the passedInt, just before you submit it and you will see how everything is fine.
在提交值之前,尝试为passedInt分配一个值,您将看到一切正常。
Edit: Next time you have a problem, post the code instead of screenshots. 编辑:下次遇到问题时,请发布代码而不是屏幕截图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.