Add this code in your searchBarSearchButtonClicked: as follows,
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBarr
{
for(annotation in mapView.annotations)
{
[mapView selectAnnotation:annotation animated:NO];
}
searchData = searchBarr.text;
Your mistake was that you didn't set the animated value for selectAnnotation:animated:
to NO
. Hence it is showing the last annotation. Which is active.