Keg*_* K. 4 firebase swift firebase-realtime-database swift3
我真的不能得到什么问题?
我正在尝试从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.
}
Run Code Online (Sandbox Code Playgroud)
ron*_*ory 15
改变这个:
ref.child("Settings").child("service_types").observe(.value) { (snapshot) in
}
Run Code Online (Sandbox Code Playgroud)
对此:
ref.child("Settings").child("service_types").observe(.value, with: { snapshot in
})
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1646 次 |
最近记录: |