I am trying to create an OSX Swift app with Firebase. I can write to Firebase following the examples, but is not able to read the data back correctly. I have tried using the .Value listener and println(snapshot.value), it appears that the value returned is not correct.
let userRoot = "https://inkcloud.firebaseio.com/users/" + user
ref = Firebase(url:userRoot)
ref!.observeEventType(.ChildChanged, withBlock: { snapshot in
let result = snapshot.value.objectForKey("test") as? String
println("the result is \(result)")
}, withCancelBlock: { error in
println(error.description)
})
I get compiler error: '() -> AnyObject!' does not have a member named 'objectForKey'
Any help would be appreciated.
Ben