Invalid MapKit iPhone User Address

I am trying to set the coordinate of the display center as the location of users:

[self.mapView setCenterCoordinate:[[[self mapView] userLocation] coordinate]];

However, I get a crash related to the user's wrong location:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Coordinate -180.00000000, -180.00000000'

Has anyone else had this error before? Or do you know how to fix it?

Thanks for the advanced.

XcodeDev.

+3
source share
1 answer

Turns out you need to get [[[[self mapView] userLocation] location] coordinate], not the mapView coordinate, userLocation.

+3
source

Source: https://habr.com/ru/post/1796412/


All Articles