title: creating CLLocationCoordinate2D on the fly while conforming to MKAnnotation protocol
body: <p>I have <code>MyClass</code> that conforms to <code>MKAnnotation</code> protocol. according to <a href="http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKAnnotation_Protocol/Reference/Reference.html#//apple_ref/occ/intf/MKAnnotation" rel="nofollow">documentation</a>, class is required to implement <code>coordinate</code> property which should return <code>CLLocationCoordinate2D</code> instance.
  My first implementation was like this:</p>
  
  <pre><code>-(CLLocationCoordinate2D)coordinate{
     return MKCoordinateForMapPoint(MKMapPointMake(self.details.latitude, self.details.longitude));
  }
  </code></pre>
  
  <p>but this did not worked: whenever I call <code>[self.mapView addAnnotation:instanceOfMyClass];</code> it just simply wasn't added to the <code>annotations</code> array of the <code>mapView</code>!</p>
  
  <p>So, the solution for me was to define an instance variable <code>_coordinate</code> in <code>MyClass</code> and implement protocol conformance like this:</p>
  
  <pre><code>-(CLLocationCoordinate2D)coordinate
  {
      _coordinate.latitude = self.details.latitude;
      _coordinate.longitude = self.details.longitude;
      return _coordinate;
  }
  </code></pre>
  
  <p>which now worked.
  So, the question here is WHY it is needed to have an instance variable and creating <code>CLLocationCoordinate2D</code> on-the-fly doesn't work?</p>