Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何从Firebase到table chat检索数据?_Ios_Objective C_Firebase_Firebase Realtime Database - Fatal编程技术网

Ios 如何从Firebase到table chat检索数据?

Ios 如何从Firebase到table chat检索数据?,ios,objective-c,firebase,firebase-realtime-database,Ios,Objective C,Firebase,Firebase Realtime Database,我从doc Firebase尝试过,但是我应该在哪里显示桌面聊天?到目前为止,我所尝试的: Firebase *ref = [[Firebase alloc] initWithUrl: @"https://simplechatapps.firebaseio.com"]; [[[ref queryOrderedByChild:@"message"] queryLimitedToLast:1] observeEventType:FEventTypeChildAdded withBlock:^(FDa

我从doc Firebase尝试过,但是我应该在哪里显示桌面聊天?到目前为止,我所尝试的:

Firebase *ref = [[Firebase alloc] initWithUrl: @"https://simplechatapps.firebaseio.com"];
[[[ref queryOrderedByChild:@"message"] queryLimitedToLast:1] observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot) {
    NSArray *message = snapshot.value[@"message"];
    NSLog(@"%@",message);


}];
下面是数据的样子

--17
 --chat
   -Kal21gac2x2Za6q-Yq6
       from: "13"
       message: "hallo"
       sender: "c52fb228be35675a"
       time: "1484734081595"
       to:  "0"
注:17是聊天室

最终,我使用ZHCHAT来帮助我完成申请。
但是我在从firebase检索数据时遇到了死锁

检查消息的类型,添加
NSLog(@“%@),NSStringFromClass([MessageClass])@iphone类型为NSCFString