IOS Firebase: Schleife alle Schlüssel in snapshot.value erhalten unordentliche Position
Ich erhalte den Schnappschuss vom Firebase-Server wie im folgenden Protokoll. Jetzt möchte ich alle Schlüssel in einer Momentaufnahme schleifen, aber ich habe eine unordentliche Position.
Ich weiß nicht warum das passiert ist. Jede Hilfe wäre sehr dankbar
Hier ist der Code zum Drucken des Protokolls
NSLog(@"snapshot = %@",snapshot.value);
for (NSString *keyPath in snapshot.value) {
NSLog(@"keyPath = %@",keyPath);
}
Hier ist das Protokoll
2016-04-20 11:48:04.177 EarCrush[5241:79090] snapshot = {
"-KFlrXzqsSa50GVnJkqk" = {
conversationID = "2886-2377";
text = Okteh;
time = "20-04-2016 11:12";
};
"-KFlrgrvdR_uj2o1ltaw" = {
conversationID = "2886-2377";
text = "How are you determining";
time = "20-04-2016 11:12";
};
"-KFlrhSBbVnx4XyWjQPy" = {
conversationID = "2886-2377";
text = "Message 2 ..... ";
time = "20-04-2016 11:12";
};
"-KFlrhzx0TK5CeSR3aAA" = {
conversationID = "2886-2377";
text = "Message 3: Hello world ";
time = "20-04-2016 11:12";
};
}
2016-04-20 11:48:04.177 EarCrush[5241:79090] keyPath = -KFlrhzx0TK5CeSR3aAA
2016-04-20 11:48:04.178 EarCrush[5241:79090] keyPath = -KFlrhSBbVnx4XyWjQPy
2016-04-20 11:48:04.179 EarCrush[5241:79090] keyPath = -KFlrXzqsSa50GVnJkqk
2016-04-20 11:48:04.179 EarCrush[5241:79090] keyPath = -KFlrgrvdR_uj2o1ltaw