title: Pulling coordinates for MapView annotations from MySQL database, but annotations aren't showing?
body: <p>I'm trying to pull coordinates for my MapView from a MySQL database, but for some reason my coordinates just aren't showing up on the MapView?</p>
  
  <p>See below my code.</p>
  
  <p><strong>MapViewController.h file</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;MapKit/MapKit.h&gt;    
  
  @interface MapViewController : UIViewController  &lt;MKMapViewDelegate&gt; 
  @property (nonatomic, strong) IBOutlet MKMapView *mapView;
  @property (nonatomic, retain) NSMutableArray *dispensaries;
  @property (nonatomic, retain) NSMutableData *data;
  @end
  </code></pre>
  
  <p><strong>MapViewController.m</strong></p>
  
  <pre><code>#import "MapViewController.h"
  #import "MapViewAnnotation.h"
  #import "JSONKit.h"
  
  @implementation MapViewController
  @synthesize mapView;
  @synthesize dispensaries;
  @synthesize data;
  
  #pragma mark - View lifecycle
  
  - (void)viewDidLoad {        
      [super viewDidUnload];
  
      NSLog(@"Getting Device Locations");
      NSString *hostStr = @"http://stylerepublicmagazine.com/dispensaries.php";
      NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:hostStr]];
      NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];
      NSLog(@"server output: %@", serverOutput);
      NSMutableArray *array = [[[serverOutput objectFromJSONString] mutableCopy] autorelease];   
      dispensaries = [serverOutput objectFromJSONString];
      NSLog(@"%@", [serverOutput objectFromJSONString]);
  
      for (NSDictionary *dictionary in array) {
              assert([dictionary respondsToSelector:@selector(objectForKey:)]);
  
              CLLocationCoordinate2D coord = {[[dictionary objectForKey:@"lat"] doubleValue], [[dictionary objectForKey:@"lng"] doubleValue]};
  
              MapViewAnnotation *ann = [[MapViewAnnotation alloc] init];
              ann.title = [dictionary objectForKey:@"Name"];
              ann.coordinate = coord;
              [mapView addAnnotation:ann];
      }        
  
      [mapView setMapType:MKMapTypeStandard];
      [mapView setZoomEnabled:YES];
      [mapView setScrollEnabled:YES];
  
      self.mapView.delegate = self;
  }
  
  
  - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation     {
      MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userLocation.coordinate, 800, 800);
      [self.mapView setRegion:[self.mapView regionThatFits:region] animated:YES];
  
      MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
      point.coordinate = userLocation.coordinate;
      point.title = @"You Are Here";
      point.subtitle = @"Your current location";
  
      [self.mapView addAnnotation:point];
  }
  </code></pre>
  
  <p><strong>MapViewAnnotation.h</strong></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;MapKit/MKAnnotation.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  
  @interface MapViewAnnotation : NSObject &lt;MKAnnotation&gt; {
      CLLocationCoordinate2D coordinate;
      NSString *title;
      NSString *subtitle;
  }    
  @property (nonatomic, assign) CLLocationCoordinate2D coordinate;
  @property (nonatomic, copy) NSString *title;
  @property (nonatomic, copy) NSString *subtitle;
  @end
  </code></pre>
  
  <p><strong>MapViewAnnotation.m</strong></p>
  
  <pre><code>#import "MapViewAnnotation.h"
  
  @implementation MapViewAnnotation    
  @synthesize title, coordinate, subtitle;
  
  -(void)dealloc{
      [title release];
      [super dealloc];
  }    
  
  @end
  </code></pre>