每次我運行此我得到這個錯誤:致命錯誤:致命錯誤火力地堡快照
Unexpectedly found nil while unwrapping an Optional value 2017-09-15 06:30:04.650075+0200 RollerBank[845:211470] fatal error: unexpectedly found nil while unwrapping an Optional value.
我不知道我已經做錯了。有人能幫助我嗎?
func reload(){
//get data
Database.database().reference().child("Rollerbanken").observe(.value, with: { (snapshot) in
for item in snapshot.children{
if let itemDict = snapshot.value as? NSDictionary {
let annotation = MKPointAnnotation()
annotation.title = itemDict["TypeControle"] as! String
let tijd = itemDict["Tijd"] as! String
annotation.subtitle = "Geplaatst om \(tijd)"
let getLatitude = itemDict["Latitude"] as! Double
let getLongitude = itemDict["Longitude"] as! Double
annotation.coordinate = CLLocationCoordinate2D(latitude: getLatitude, longitude: getLongitude)
self.map.addAnnotation(annotation)
}
}
})
}
ü可以貼上 「Rollerbanken」 的結構? – Appygix
我有我的問題更新 –