Firebase NSDictionary 到 Textview
Firebase NSDictionary to Textview
如何将我的 firebase 数据放入 Textview 中?输入的信息作为 NSDictionary。
2016-05-24 10:15:45.523 Weather[1248:29689] {
baro = 1;
humidity = 3;
temp = 2;
}
我试过先转换为字符串然后再转换为文本视图,但这不起作用?
Firebase *usersRef = [ref childByAppendingPath: @"id/"];
[usersRef observeEventType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) {
NSLog(@"%@ -> %@", snapshot.key, snapshot.value);
NSLog(@"%@", snapshot.value);
string1 = snapshot.value;
任何帮助将不胜感激。
试试这个
NSDictionary *dict=[NSDictionary dictionaryWithDictionary:snapshot.value];
NSString *stri=[NSString stringWithFormat:@"%@",dict];
我在 textview 上得到了类似这样的结果
这可能不是您想要的,但是,这将帮助您入门。
希望这有帮助。
如何将我的 firebase 数据放入 Textview 中?输入的信息作为 NSDictionary。
2016-05-24 10:15:45.523 Weather[1248:29689] {
baro = 1;
humidity = 3;
temp = 2;
}
我试过先转换为字符串然后再转换为文本视图,但这不起作用?
Firebase *usersRef = [ref childByAppendingPath: @"id/"];
[usersRef observeEventType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) {
NSLog(@"%@ -> %@", snapshot.key, snapshot.value);
NSLog(@"%@", snapshot.value);
string1 = snapshot.value;
任何帮助将不胜感激。
试试这个
NSDictionary *dict=[NSDictionary dictionaryWithDictionary:snapshot.value];
NSString *stri=[NSString stringWithFormat:@"%@",dict];
我在 textview 上得到了类似这样的结果
这可能不是您想要的,但是,这将帮助您入门。 希望这有帮助。