MKMapView delegate

<MKMapViewDelegate,CLLocationManagerDelegate> CLLocationManager *locmngr;

– (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation

{

MKAnnotationView *mkvw=[[MKAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:@”k”];

mkvw.image=[UIImage imageNamed:@”feel_freedom.jpg”];

MKPinAnnotationView *pinano=[[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:@”k”];

pinano.pinColor=MKPinAnnotationColorPurple;

return mkvw; // return pinano;

}

–  (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
NSLog(@”%@”,locations); 
}

–  (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error; {
NSLog(@”%@”,error); }

Leave a comment