我正在尝试从解析中下载一些数据但是我收到一条错误消息,说明"类型值' PFObject'没有会员名称'我究竟做错了什么?
这是我的解析仪表板截图
这是我上传数据以解析的代码:
var coordinates = PFGeoPoint (latitude: (newCoordinate2.latitude), longitude:(newCoordinate2.longitude))
var aboutSpot = PFObject(className: "spotdetail")
aboutSpot ["PFGeoPoint"] = coordinates
aboutSpot["name"] = "name"
aboutSpot.saveInBackgroundWithBlock { (succes, error) -> Void in
print("separate name and geopoint have been saved")
}
这是我下载数据的代码:
var query = PFObject.query()
query!.findObjectsInBackgroundWithBlock ({ (objects, error) in
if let places1 = objects {
for object in places1 {
if let spotdetail = object as? PFObject {
self.rideSpots.append(spotdetail.name!)
}
}
}
print(self.rideSpots)
})
也不是说
的那一行 if let spotdetail = object as? PFObject {
我收到警告"conditional cast from 'PFObject' to 'PFObject' always succeeds
我可以很容易地解决这个问题,但我想提一下,以防它可以帮助解决问题