如何从解析中获取数组数组

时间:2016-03-22 11:10:05

标签: ios swift parse-platform

我已经将一个数组数组存储在一个名为“Polygon”的列中,如下所示:
    [[13.74653990489156,100.4923625509455],[13.74652348443379,100.4925687879127],[13.74636831105128,100.4925992163138],[13.74660230262049,100.4924453837896]]

但是我无法访问那些数据= rom parse。

我尝试过这种方法:

 private func gettingPolygonsFromParse() {
    let query = PFQuery(className: "AttractionPolygon")
    query.findObjectsInBackgroundWithBlock { (polygonsArray, error) -> Void in
        if error == nil {                
            for polygon in polygonsArray as! [PFObject] {
               // I am unable to get polygon value from here. 

            }
        }
    }
}

1 个答案:

答案 0 :(得分:1)

目前还不清楚Polygon列是否属于AttractionPolygon类。

如果是,请尝试:

for polygon in polygonsArray as! [PFObject] {
    if let array1 = polygon["Polygon"] as? [[Double]] {
        for item in array1 {
            print(item)
        }
    }
}