Search code examples
swiftstringfirebasefirebase-realtime-databasensobject

Getting data from Firebase Realtime Database returns nil Swift


I don't understand, I tried using NSObjects, I am able to print on screen a String value from my Real Time Firebase Database but when I try to assign it to a UILabel it crash with a nil value exception:

enter image description here

Why is that?


Solution

  • Check your UILabel weatherLabel is not nil. It seems value is not nil, so you better check your connection between UIStoryboard to your UIViewController to link your UILabel correctly.