0

I have stored a array of array in parse in a column named "Polygon" like this:
[[13.74653990489156,100.4923625509455],[13.74652348443379,100.4925687879127],[13.74636831105128,100.4925992163138],[13.74660230262049,100.4924453837896]]

But I am unable to access those data =rom parse.

I have tried this method:

 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 Answer 1

1

It's unclear if Polygon column belongs to AttractionPolygon class.

If yes, try this:

for polygon in polygonsArray as! [PFObject] {
    if let array1 = polygon["Polygon"] as? [[Double]] {
        for item in array1 {
            print(item)
        }
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @Andrey . Worked for me! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.