0
我有一個看起來像這樣的屬性:無法轉換CLLocationDegrees的價值預期參數shopProperties
class shopProperties: NSObject {
var Latitude: CLLocationDegrees?
}
當我執行此代碼:
databaseRef.observeSingleEvent(of: .value, with: { (snapshot) in
for child in snapshot.children {
let snap = child as! FIRDataSnapshot
let dictionary = snap.value as! [String: AnyObject]
let shopProper = shopProperties()
var latitude = dictionary["Latitude"]
var longtitude = dictionary["Longtitude"]
shopProper.Latitude = latitude as! CLLocationDegrees
print(shopProper.Latitude)
self.shopProperty.append(shopProper.Latitude)
})
我得到這個錯誤在編譯器錯誤編譯時間:
無法將CLLocationDegrees的值轉換爲預期參數ShopProperties
我的問題是我將如何追加這個,所以我可以在我的課堂上訪問它?
你究竟在哪條線上得到這個錯誤? – nayem
On self.shopProperty.append(shopProper.Latitude) –
「self.shopProperty」變量的類型是什麼? – nayem