Skip to content
Browse files

Fixes to removing map annotations on project change

  • Loading branch information...
1 parent ccd4d1b commit 3b8dbbb840937028d16393f92e888ec5e2400483 @deepwinter committed May 22, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 Source/Views and Controllers/MapViewController.m
View
7 Source/Views and Controllers/MapViewController.m
@@ -220,9 +220,10 @@ - (void) addAnnotations {
//Cludgy way of removing all annotations
//Once we switch to liveQuery this will be changed
//TODO: Change when switch to live query
- for (int i =0; i < [mapView.annotations count]; i++) {
- if ([[mapView.annotations objectAtIndex:i] isKindOfClass:[RHMapAnnotation class]]) {
- [mapView removeAnnotation:[mapView.annotations objectAtIndex:i]];
+ NSArray * annotations = mapView.annotations;
+ for (int i =0; i < [annotations count]; i++) {
+ if ([[annotations objectAtIndex:i] isKindOfClass:[RHMapAnnotation class]]) {
+ [mapView removeAnnotation:[annotations objectAtIndex:i]];
}
}
self.activeDocuments = nil;

0 comments on commit 3b8dbbb

Please sign in to comment.
Something went wrong with that request. Please try again.