Ios 在MKMapView中显示parse.com中的地理点

Ios 在MKMapView中显示parse.com中的地理点,ios,swift,parse-platform,mkmapview,geopoints,Ios,Swift,Parse Platform,Mkmapview,Geopoints,我正试图建立一个应用程序显示我最喜欢的景点与斯威夫特 我已经从parse.com存储了我的高程点信息。但我仍然无法显示和检索数据(点名称和地质点)并将其传递给MKMapView。有人能给我举个例子吗? 我也发现了这个问题,但由于我刚刚开始学习swift,我不了解Objective-C。 如果有人能帮助我,我真的很感激。提前谢谢你。经过谷歌搜索和反复试验,这是我现在最好的答案。希望对别人有帮助 // retrieve data from parse.com let query:PFQ

我正试图建立一个应用程序显示我最喜欢的景点与斯威夫特

我已经从parse.com存储了我的高程点信息。但我仍然无法显示和检索数据(点名称和地质点)并将其传递给MKMapView。有人能给我举个例子吗?

我也发现了这个问题,但由于我刚刚开始学习swift,我不了解Objective-C。


如果有人能帮助我,我真的很感激。提前谢谢你。

经过谷歌搜索和反复试验,这是我现在最好的答案。希望对别人有帮助

   // retrieve data from parse.com
    let query:PFQuery = PFQuery(className: "SpotList")
    query.orderByAscending("SpotName")
    query.findObjectsInBackgroundWithBlock{ (objects:[AnyObject]! , error:NSError!)-> Void in
        if !(error != nil){
            for object in objects!   {
                self.SpotNames.append(object["SpotName"] as String)
                self.SpotGeoPoints.append(object["SpotLocation"] as PFGeoPoint)
                self.SpotLocationLatitudes.append(self.SpotGeoPoints.last?.latitude as CLLocationDegrees!)
                self.SpotLocationLongitudes.append(self.SpotGeoPoints.last?.longitude as CLLocationDegrees!)

                var annotation = MKPointAnnotation()
                annotation.coordinate = CLLocationCoordinate2DMake(self.SpotLocationLatitudes.last!, self.SpotLocationLongitudes.last!)
                annotation.title = self.SpotNames.last!
                self.mainMap.addAnnotation(annotation)
                self.mainMap.showsUserLocation = true
            }
        }
    }

你能发布你遇到问题的代码,并描述你遇到的问题吗?