When you select a row in the tableView
, your method tableView:didSelectRowAtIndexPath:
is called. So you have to use there the indexPath
to read the data from your model, and get the title.
You could then read all annotations from your mapView
, using its annotations
property. In the array that you get, scan the objects until you find the annotation which has the same title. Then you can send your mapView
the message selectAnnotation:animated:
, and it will be shown.
Please be aware that there are more clever approaches to this problem, but for a first try it should work.
3
solved Open Map Annotation from Selected Row in Table View