Closed pedrovieira closed 11 years ago
I retrieve the user's location using CLLocationManager. Here's the code where I add a new annonation (CLLocationManager delegate method):
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ [locationManager stopUpdatingLocation]; CLLocationCoordinate2D coord = {.latitude = newLocation.coordinate.latitude, .longitude = newLocation.coordinate.longitude}; MKPointAnnotation *pin = [[MKPointAnnotation alloc] init]; pin.title = @"Hi."; pin.coordinate = coord; [_mapView addAnnotation:pin]; }
This is the output in my console:
Wasn't able to create a MKAnnotationView for annotation: <MKPointAnnotation: 0x10ad67710> <(latitude value), (longitude value)> Hi. - (null)
Any ideas? Thanks!
Any ideas? I'm really needing some help here.
My bad, I completely forgot to implement the - (MKAnnotationView )mapView:(MKMapView )mapView viewForAnnotation:(id)annotation method.
I retrieve the user's location using CLLocationManager. Here's the code where I add a new annonation (CLLocationManager delegate method):
This is the output in my console:
Any ideas? Thanks!