title: Trying To Call PList data in a for Loop (iOS)
body: <p>I have, what I believe to be a simple question with a simple answer that I cannot figure out for the life of me. I've created a plist that I'm trying to use to populate a MapView annotation with info. I've gone through some tutorials and this is the code I've decided to go with (running a loop).</p>
  
  <p>It wasn't showing the pins on the map so I decided to set up NSLogs at different point throughout the code to find the problem and if you look at the code below, it logs out "read1" but not "read2" so it's actually a problem somewhere in the beginning of the loop.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      NSMutableArray *annotations = [[NSMutableArray alloc]init];
      NSString *path = [[NSBundle mainBundle] pathForResource:@"MillersStores" ofType:@"plist"];
      NSMutableArray *anns = [[NSMutableArray alloc] initWithContentsOfFile:path];
      NSLog(@"read1");
      for(int i = 0; i &lt; [anns count]; i++) {
          NSLog(@"read2");
          float realLatitude = [[[anns objectAtIndex:i] objectForKey:@"Latitude"] floatValue];
          float realLongitude = [[[anns objectAtIndex:i] objectForKey:@"Longitude"] floatValue];
          NSLog(@"read3");
  
          MillersLocations *myAnnotation = [[MillersLocations alloc] init];
          CLLocationCoordinate2D theCoordinate;
          theCoordinate.latitude = realLatitude;
          theCoordinate.longitude = realLongitude;
          myAnnotation.coordinate = theCoordinate;
          myAnnotation.title = [[anns objectAtIndex:i] objectForKey:@"Title"];
          myAnnotation.subtitle = [[anns objectAtIndex:i] objectForKey:@"Address"];
          [mapView addAnnotation:myAnnotation];
          [annotations addObject:myAnnotation];
          [myAnnotation release];
      }
  }
  </code></pre>
  
  <p>I seem to have simple syntax errors for time to time so I'm thinking it may be something along those lines. Thanks for the help!</p>
  
  <p>--</p>
  
  <h2>EDIT</h2>
  
  <p>Here's some of the XML code of my PList file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;Root&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;Title&lt;/key&gt;
              &lt;string&gt;Neighborhood Market #90&lt;/string&gt;
              &lt;key&gt;Address&lt;/key&gt;
              &lt;string&gt;5117 Mudd Tavern Rd., Thornburg, VA 22580&lt;/string&gt;
              &lt;key&gt;Latitude&lt;/key&gt;
              &lt;real&gt;38.133069&lt;/real&gt;
              &lt;key&gt;Longitude&lt;/key&gt;
              &lt;real&gt;-77.512423&lt;/real&gt;
              &lt;key&gt;Phone Number&lt;/key&gt;
              &lt;string&gt;(757) 874-5806&lt;/string&gt;
          &lt;/dict&gt;
          &lt;dict&gt;
              &lt;key&gt;Title&lt;/key&gt;
              &lt;string&gt;Neighborhood Market #89&lt;/string&gt;
              &lt;key&gt;Address&lt;/key&gt;
              &lt;string&gt;4902 Hampton Blvd., Norfolk, VA 23508&lt;/string&gt;
              &lt;key&gt;Latitude&lt;/key&gt;
              &lt;real&gt;36.887794&lt;/real&gt;
              &lt;key&gt;Longitude&lt;/key&gt;
              &lt;real&gt;-76.302544&lt;/real&gt;
              &lt;key&gt;Phone Number&lt;/key&gt;
              &lt;string&gt;(757) 440-7792&lt;/string&gt;
          &lt;/dict&gt;
          &lt;dict&gt;
              &lt;key&gt;Title&lt;/key&gt;
              &lt;string&gt;Neighborhood Market #88&lt;/string&gt;
              &lt;key&gt;Address&lt;/key&gt;
              &lt;string&gt;7601 Sunset Crossing Dr., Gainesville, VA 20155&lt;/string&gt;
              &lt;key&gt;Latitude&lt;/key&gt;
                  &lt;real&gt;38.792053&lt;/real&gt;
              &lt;key&gt;Longitude&lt;/key&gt;
              &lt;real&gt;-77.62994399999999&lt;/real&gt;
              &lt;key&gt;Phone Number&lt;/key&gt;
              &lt;string&gt;(571) 248-8580&lt;/string&gt;
          &lt;/dict&gt;
  </code></pre>