Skip to content

Instantly share code, notes, and snippets.

@mafellows
Created April 8, 2014 21:19
Show Gist options
  • Save mafellows/10194214 to your computer and use it in GitHub Desktop.
Save mafellows/10194214 to your computer and use it in GitHub Desktop.
Handling Geo Points with Parse
// To obtain the current location...
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
if (error) {
// Unable to get user's location...
} else {
MKAnnotation *annotation = [[MKAnnotation alloc] init];
annotation.coordinate = CLLocationCoordinate2DMake(geoPoint.latitude, geoPoint.longitude);
annotation.title = @"My location!";
[self.mapView addAnnotation:annotation]; // Obviously you want to have a MKMapView initialized
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment