用户是父级,在其下是用户uid和Dream,杂货店列表是注释标题,并且它们具有内容。我试图观察标题的值,并将它们放入数组以放入表格视图中。到目前为止,这是我所拥有的,但是由于注释的标题每次都不同,因此我不知道如何为此建模:
class list_graph {
int size, s;
llist* buffer;
llist ** v ;
public:
list_graph(int s) : size(0), s(s),
buffer(new llist[s]), v(new llist* [s]) {
for (int i(0); i < s; ++i)
v[i] = &buffer[i];
}
~list_graph() {
delete[] v;
delete[] buffer;
}
};
这会打印出包括电子邮件和提供者在内的所有内容,但是我不希望我只打印“梦想和杂货清单”
答案 0 :(得分:1)
使用以下代码获取所需的值
guard let uid = Auth.auth().currentUser?.uid else {
return
}
let ref = Database.database().reference().child("users").child("\(uid)")
ref.child("Dream").observe(.value, with: { (snapshot) in
guard let dictionary = snapshot.value as? [String : AnyObject] else {
return
}
print(dictionary["content"] as? String)
}, withCancel: nil)
ref.child("Grocerylist").observe(.value, with: { (snapshot) in
guard let dictionary = snapshot.value as? [String : AnyObject] else {
return
}
print(dictionary["content"] as? String)
}, withCancel: nil)