我通过Parse获得用户的位置,对象作为PFGeoPoint返回。通过这样做,我将其转换为CLLocation / CLLocationCoordinate2D:
CLLocation *loc = [[CLLocation alloc] initWithLatitude:self.geoPoint.latitude longitude:self.geoPoint.longitude];
CLLocationCoordinate2D coordinate = [loc coordinate];问题是要在mapView上添加一个注释,看起来我需要一个MKPointAnnotation。我将如何将必须将其添加到我的mapView中的内容进行转换?
发布于 2014-12-23 22:19:17
您可以通过以下方式为特定位置创建MKPointAnnotation:
MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
annotation.coordinate = coordinate;然后,可以将该注释添加到map视图中。
[mapView addAnnotation:annotation];https://stackoverflow.com/questions/27628408
复制相似问题