简体   繁体   English

如何使用Swift在Firebase中更新用户的分数?

[英]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 ']''" '#''$''['或']''“

ViewController1 ViewController1

ViewController2 ViewController2

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.

相关问题 对于使用firebase登录的特定用户,如何使用swift保存用户的个人资料图片并加载? - How do i save a user 's profile picture with swift and load it, for the specific user logged in using firebase? 在 Swift 中更新用户的 Firebase 密码 - Update a User's Firebase password in Swift 用户使用Firebase Auth和Swift验证电子邮件后,如何重定向回我的应用程序? - How can I redirect back to my app after the user has verified their email using Firebase Auth and Swift? 使用Swift和Firebase,如何从经过身份验证的应用程序用户向自己发送自动电子邮件? - Using Swift and Firebase, how can I send an automated email to myself from an authenticated user of my app? 如何使用Swift在Firebase中创建具有多个属性的用户? - How can I create a user with multiple attributes in Firebase with Swift? 如何快速从Firebase中为用户获取特定数据? - how can i get a specific data for a user from firebase in swift? 使用Swift在XCode上单击按钮时,如何使分数上升1分 - How Can I Make the Score Go Up One Point When a Button is Clicked on XCode using Swift 如何使用 swift 更新 firebase 中的数据? - How to update data in the firebase using swift? 如何使用Swift在Firebase中更新令牌? - How to update token in firebase using swift? 如何使用swift更新firebase firestore中的文档? - How to update a document in firebase firestore using swift?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM