我正在尝试将图像添加到我的 MKAnnotation。我有下面的代码。我将如何添加 @"map_icon.png" 到这个?任何帮助都会很棒。谢谢!
mapView.m 文件:
// retrieve latitude and longitude from the dictionary entry
location.latitude = [dictionary[@"placeLatitude"] doubleValue];
location.longitude = [dictionary[@"placeLongitude"] doubleValue];
// create the annotation
newAnnotation = [[MapViewAnnotation alloc] initWithTitle:dictionary[@"name"]
andCoordinate:location];
MapViewAnnotation.m 文件
- (id)initWithTitle:(NSString *)ttl andCoordinate:(CLLocationCoordinate2D)c2d
{
title = ttl;
coordinate = c2d;
return self;
}
谢谢!