【发布时间】:2016-05-12 16:34:59
【问题描述】:
我正在尝试检索 firebase 信息并将其显示在标签中。
// Get a reference to our posts
Firebase *ref = [[Firebase alloc] initWithUrl:@"**************firebaseio.com/"];
// Attach a block to read the data at our posts reference
[ref observeEventType:FEventTypeValue withBlock:^(FDataSnapshot *snap) {
NSLog(@"%@", snap.value);
} withCancelBlock:^(NSError *error) {
NSLog(@"%@", error.description);
}];
我已尝试添加 _label.text = snap.value,但由于某种原因,该应用程序仍然不断崩溃。
我需要检索大量信息,但对于此测试,我只想检索数据库中的唯一内容。在 NSLOG 中,我可以看到从数据库中检索到的值,但似乎无法将值放在标签中。
【问题讨论】:
-
这是一个简单的解决方法,但您能否发布您的 Firebase 结构,以便我们使用与您的结构匹配的代码来回答?请将其发布为文本(无图像),可以通过 Firebase 仪表板->导出按钮获取