romaonthego / REMarkerClusterer

REMarkerClusterer creates and manages per-zoom-level clusters for large amounts of markers.
MIT License
195 stars 30 forks source link

index out of bounds in REMarkerClusterer Xcode7 #35

Open sunlyear opened 9 years ago

sunlyear commented 9 years ago

I have got an error of index out of bounds when build with Xcode7. The crash is inside REMarkerClusterer class in method "mapView:mapView regionDidChangeAnimated:animated". Please help fixing this.

sebasdeweert commented 9 years ago

Solved.. Replace the line with this:

if ([self.mapView.selectedAnnotations count] == 0) {
    [self.mapView deselectAnnotation:nil animated:NO];
} else {
    [self.mapView deselectAnnotation:[self.mapView.selectedAnnotations objectAtIndex:0] animated:NO];
}
kennethmatata88 commented 9 years ago

That works well. Thanks.