Here is my situation. For some reason my annotation coordinates that are saved in core data do not seem to match the coordinates that I can retrieve from the pins location on the map.
So, I save my data into core data using something like:
[ride setLatitude:[NSNumber numberWithDouble:newRidePlacemark.coordinate.latitude]];
[ride setLongitude:[NSNumber numberWithDouble:newRidePlacemark.coordinate.longitude]];
I am pretty positive that is the right format to save the long and lat in. But, the issue appears when I compare the coordinate that I have in core data with the coordinate of the dropped pin. I use the method and log to see what location the pin is at:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
NSLog(@"%f, %f", view.annotation.coordinate.latitude, view.annotation.coordinate.longitude);
This gives me something like:
38.119432, -122.225647
But, at that same time, I am checking what is saved in core data for that pin, and I have:
38.11943249695161, -122.2256469726562
Where did that difference come from? Why was one shortened? This is a real problem, because when I try to remove annotations, the coordinates do not match, and the annotation does not get removed.
Have I missed something here?