【发布时间】:2016-10-15 09:19:17
【问题描述】:
我真的不明白怎么回事?
我正在尝试从 firebase Settings 节点加载一些设置数据。其他功能中其他节点的相同代码可以工作,但这一个是模棱两可的。为什么?
var ref:FIRDatabaseReference! //Global variable
override func viewDidLoad() {
super.viewDidLoad()
self.mapView.delegate = self
if CLLocationManager.locationServicesEnabled() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestWhenInUseAuthorization()
locationManager.startUpdatingLocation()
// monitorRegion()
} else {
// Alert to enable location services on iphone first
}
ref = FIRDatabase.database().reference(fromURL: "https://*******.firebaseio.com/")
//The error is here
ref.child("Settings").child("service_types").observe(.value) { (snapshot) in
}
// Do any additional setup after loading the view.
}
【问题讨论】:
-
错误在线
ref = ..或ref.child("Settings") -
@Dravidian ref.child("设置")
-
查看@ronatory 答案?并用实际错误更新您的问题
-
有什么更新吗? @KeghamK。
标签: swift firebase firebase-realtime-database swift3