When I try to use map in iOS 8, I get below error.
Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationMa
You need to implement the CLLocationManager Delegate ( -(void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations ) to get location updates.
Here's a code snippet for your reference:
-(void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation *currentLocation = [locations lastObject];
NSLog(@"ffffff===%f===%f", currentLocation.coordinate.latitude, currentLocation.coordinate.longitude);
}
Alternatively, you can implement the Mapkit's following delegate method:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
MKUserLocation *myLocation = userLocation;
NSLog(@"ffffff===%f===%f", myLocation.coordinate.latitude, myLocation.coordinate.longitude);
}