title: iPhone: Cells order changes in UITableView Section After Call to reloadSections: Method
body: <p>I have a table with two sections. A segmented control in first sections changes which rows are displayed in the second section. My problem is that the order of the rows and which row are displayed in the second section shifts improperly upon each subsequent press of a button in the segmented control. </p>
  
  <p>I allow a user to add a product to a shopping list 3 different ways: by name, by barcord and by taking a picture with a camera.  I have 3 buttons in  a <code>UISegmentedControl</code> so the users can select which method to use. Depending on which segement the user selects the fields in the second segment should change to show cells relevant to that method. </p>
  
  <pre><code>Section 0:
      0 row with segmented control showing name, barcode and camera buttons
  Section 1:
      // button zero, name button
      0 row with textfield
      1 row with textfield 
  or 
      // button 1, barcode button
      0 row with textfield
  or 
      // button 2, camera button
      // shows camera view
  </code></pre>
  
  <p>I've put placeholders in each UITextField.  </p>
  
  <p>Each time a button in the segmented control is clicked, I call a <code>pickOne:</code> method that updates the tablevew. In that method, I construct a NSIndexSet with NSRange of (1, 1), and then I call the <code>reloadSections:</code> method of the UITableViewController with the NSIndexSet as a parameter.  </p>
  
  <p>When the view appears for the first time, everything is ok but when I click the buttons repeatedly, the order of the cells changes. Cells containing the two textFields for the button0 and the new placeHolders are written over the old ones.
  Worse, sometimes when I click on button 0, it shows me only the second cell of the two cells.</p>
  
  <p>My detailed code can be seen here <a href="http://pastebin.com/9GwMpCS9" rel="nofollow noreferrer">http://pastebin.com/9GwMpCS9</a></p>