Oomph / MacMapKit

MapKit Framework for the Mac
BSD 3-Clause "New" or "Revised" License
256 stars 43 forks source link

Issue when trying to add a new annotation #36

Closed pedrovieira closed 11 years ago

pedrovieira commented 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!

pedrovieira commented 11 years ago

Any ideas? I'm really needing some help here.

pedrovieira commented 11 years ago

My bad, I completely forgot to implement the - (MKAnnotationView )mapView:(MKMapView )mapView viewForAnnotation:(id)annotation method.