从解析中下载数据我做错了什么?

时间:2016-06-23 13:41:19

标签: swift parse-platform

我正在尝试从解析中下载一些数据但是我收到一条错误消息,说明"类型值' PFObject'没有会员名称'我究竟做错了什么?

这是我的解析仪表板截图

enter image description here

这是我上传数据以解析的代码:

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

我可以很容易地解决这个问题,但我想提一下,以防它可以帮助解决问题

0 个答案:

没有答案