title: iPhone Dev = maps and deselecting annotations
body: <p>I am successfully drawing annotations on a map using an array of annotations. I can even click on the annotation and change it’s colour or image. My problem arises when the use selects the second annotation and I want to dynamically change the colour or image of the first one back to a non-selected colour/image. I can get the array of all the annotations and work through the array but once I try to set the colour or image ot the array I get a similar error.</p>
  
  <pre><code>for (MKAnnotationView *ann in map.selectedAnnotations){ 
    if ([ann isMemberOfClass:[Place class]]) { 
      place = (Place *)ann; 
        if (currentPlaceID != place.placeID) { 
          UIImage *i = [UIImage imageNamed:@"pin.png"];
          ann.image = i; 
        }
  }
  </code></pre>
  
  <p>the above code works ok until I get to ann.image = i; then it errors. The errors I get are:-</p>
  
  <blockquote>
    <ul>
    <li>-[Place setImage:]: unrecognized selector sent to instance 0x4514370 Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: '** -[Place setImage:]:
    unrecognized selector sent to instance 0x4514370'</li>
    </ul>
  </blockquote>
  
  <p>Please advise as I have been going around in circles on this one for 2 days now!!!!</p>
  
  <p>Any ideas on how best to do this?</p>
  
  <p>thanks in advance</p>