Since the title
of the item.placemark
cannot be directly modified, you'll need to create a custom annotation or MKPointAnnotation
using the values from item.placemark
.
(The comment in the code above the addObject
line mentions an "MKPinAnnotation" but I think it was meant to say "MKPointAnnotation".)
The example below uses the simple option of using the pre-defined MKPointAnnotation
class provided by the SDK for creating your own, simple annotations.
Replace this line:
[annotations addObject:item.placemark];
with these:
MKPlacemark *pm = item.placemark;
MKPointAnnotation *ann = [[MKPointAnnotation alloc] init];
ann.coordinate = pm.coordinate;
ann.title = pm.name; //or whatever you want
//ann.subtitle = @"optional subtitle here";
[annotations addObject:ann];