title: iPhone :: Objective-C - Loading a list of Images from Restful Webservice into UITableView
body: <p>Hihi all,</p>
  
  <p>I have implement a mechanism for the above (in the question title), this is how it works:</p>
  
  <ol>
  <li>Create an NSURLConnection and make a call to my json webservice to get a list of records with the image URL for each of the record.</li>
  <li>In the connectionDidFinishLoading delegate, I set the returned records to my NSArray and  reload my UITableView with the NSArray, but I don't load the image at this point.</li>
  <li>In the same connectionDidFinishLoading delegate, for each of the retrieved record, I fire off separate connection to get the image data. Imagine I have 5 records returned from the previous json webservice, I will fire off 5 GET requests to get my image data for each of the records.</li>
  <li>Then this time round, in the connectionDidFinishLoading delegate, I will know this time it is fired from the request of getting image data, I will set the image data into my NSArray of my UITableView datasource and do a reloadData. For 5 records, the table will be reloaded 5 times.</li>
  <li>Everything seems working fine only if I do not reload the last 2 elements of my NSArray, otherwise, I will hit the exc_bad_access exception.</li>
  </ol>
  
  <p>Appreciate your kind advice. This might be a foolish way of doing thing.</p>
  
  <p>:)</p>