title: Enabling and Disabling Annotation Dragging (On The Fly) (iOS Mapkit)
body: <p>I've created a mapview which has a button to switch between an 'edit' mode and a 'drag' mode based on the project requirements. I realize that it's easy enough to have your annotations draggable from creation by setting them draggable in the viewForAnnotation, but the behavior required won't allow this. I've tried a couple different ways of changing the annotations to draggable without success. The first thought was to loop through the existing annotations and set each one to 'draggable' and 'selected', but I get an unrecognized selector sent to instance error (I did try instantiating a new annotation to pass in the object and re-plot while in the loop, but I get the same error as well):</p>
  
  <pre><code>NSLog(@"Array Size: %@", [NSString stringWithFormat:@"%i", [mapView.annotations count]]);
  
      for(int index = 0; index &lt; [mapView.annotations count]; index++) {
  
          if([[mapView.annotations objectAtIndex:index]isKindOfClass:[locAnno class]]){
              NSLog(@"** Location Annotation at Index: %@", [NSString stringWithFormat:@"%i", index]);
              NSLog(@"* Location Marker: %@", [mapView.annotations objectAtIndex:index]);
          }
  
          if([[mapView.annotations objectAtIndex:index]isKindOfClass:[hydAnno class]]) {
              NSLog(@"** Hydrant Annotation at Index: %@", [NSString stringWithFormat:@"%i", index]);
              NSLog(@"* Hydrant Marker: %@", [mapView.annotations objectAtIndex:index]);
  
              [[mapView.annotations objectAtIndex:index]setSelected:YES];
              [[mapView.annotations objectAtIndex:index]setDraggable:YES];
          }
      }
  </code></pre>
  
  <p>The second thought was to use 'didSelectAnnotationView', and set selected and draggable on the annotation when it's selected, and reset the properties when the mode switches back again. This works, but very poorly as the event doesn't always fire and your left to tap the annotation one or more times before it will change the properties:</p>
  
  <pre><code>- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
  NSLog(@"Annotation Selected!");
  if(!editMode) {
      view.selected = YES;
      view.draggable = YES;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The first attempt seems the most simple solution if I can get it to work. Using the didSelect method on the other hand is cumbersome and hack-licious. I'm quite new to iOS development, so I apologize if I've overlooked something novice while hammering away at this. I appreciate any insight the community can offer. Thanks much. </p>