我是Firebase的新手。我尝试在数据库中获取数据,但是我的代码不工作。这里是我的代码:如何在Firebase中获取数据?
- (void) getData{
FIRDatabaseReference *ref = [[FIRDatabase database] reference];
//READ DATA
[[[ref child:@"buysell"] child:@"users"] observeEventType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
NSDictionary *dict = snapshot.value;
NSLog(@"%@",dict);
} withCancelBlock:^(NSError * _Nonnull error) {
}];
}
它不能在withBlock:^(FIRDataSnapshot * _Nonnull snapshot)
跳。什么似乎是错的?请帮帮我。谢谢。
你有没有配置红色适当?我的意思是根据他们的指引。 –
我遵循google的文档。[link](https://firebase.google.com/docs/database/ios/read-and-write) – Rin