2016-05-24 1 views
1

Wie kann ich meine Firebase-Daten in eine Textview einfügen? Die Information kommt als NSDictionary.Firebase NSDictionary to Textview

2016-05-24 10:15:45.523 Weather[1248:29689] { 
baro = 1; 
humidity = 3; 
temp = 2; 
} 

Ich habe versucht, in String zu Textview zu konvertieren, aber das funktioniert nicht?

Firebase *usersRef = [ref childByAppendingPath: @"id/"]; 

[usersRef observeEventType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) { 
    NSLog(@"%@ -> %@", snapshot.key, snapshot.value); 


    NSLog(@"%@", snapshot.value); 

    string1 = snapshot.value; 

Jede Hilfe wird geschätzt.

+0

Also was ist das Problem, brauchen Sie String? Du brauchst testView? – Alok

+0

Ich möchte alle Informationen in eine Textansicht von dort legen, ich weiß, was zu tun ist. – vype

+0

'[snapshot.value objectForKey: @" Your Key "];' versuchen Sie es einmal ... fügen Sie es zu textview.text .... hoffe, das funktioniert –

Antwort

2

versuchen diese

NSDictionary *dict=[NSDictionary dictionaryWithDictionary:snapshot.value]; 
NSString *stri=[NSString stringWithFormat:@"%@",dict]; 

ich so etwas wie dies auf Textview führen bekam enter image description here

Das kann nicht sein, genau das, was Sie wollen, aber, Dies wird Ihnen helfen, loszulegen. Hoffe, das hilft.

+0

Ja, es greift die Daten problemlos in die Textansicht. Ja von hier kann ich wenigstens einen Anfang machen. Danke – vype

+0

ur willkommen .... @ vype –