简体   繁体   English

我在Android中知道此代码,但在以Swift语言获得相同的输出时遇到了麻烦

[英]I know this code in Android, but I'm having trouble in getting the same output in Swift language

The Code is : 代码是:

DatabaseReference newDatabaseReference = mDatabaseReference.child("loccheck").push(); 
newDatabaseReference.getKey();

I want the pushed key without actually setting the data in the Firebase for iOS (Swift) 我想要按键而不实际在iOS的Firebase中设置数据(Swift)

You may need childByAutoId swift's equivalent to android's push 您可能需要等效于android push childByAutoId swift

let key = mDatabaseReference.child("loccheck").childByAutoId().key

see Here 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在进行操作时遇到问题 - I'm having trouble getting operations working 我有这个问题。 我不断收到运行时错误,因为它同时打印2行? - I'm having trouble with this. I keep getting a run time error because it is printing 2 lines at the same time? 没有获得我在程序中寻找的输出,也遇到了用户输入等于字符串循环的麻烦 - Not getting the output I'm looking for in program, also having trouble with a user input equaling a string loop 我在使用此特定代码的 output 时遇到问题 - I'm having issue with the output with this particular code 我无法从Google Maps API获取准确的GPS位置以在Android上使用 - I'm having trouble getting accurate GPS locations from the Google Maps API for use on Android 我无法让Android搜索界面在Action Bar中运行 - I'm having trouble getting the Android Search Interface to work in the Action Bar Java-我无法让用户关闭程序 - Java - I'm having trouble getting the user to close the program 我在使用keytool获取SHA1证书时遇到问题 - I'm having trouble getting SHA1 certificate with keytool 我无法让MergeSort正常工作 - I'm having trouble getting MergeSort to work correctly 我无法让JScrollPanes实际显示滚动条 - I'm having trouble getting JScrollPanes to actually display scroll bars
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM