title: Xcode wrong object passed to UIViewController
body: <p>I have an iPhone application that reads the details of local businesses from a .csv file. There are 3 main section:</p>
  
  <ol>
  <li>Where to Sleep</li>
  <li>Where to Eat</li>
  <li>What to Do</li>
  </ol>
  
  <p>Depending on which one is clicked (e.g. Where to Sleep), you get a sub section of options like:</p>
  
  <ol>
  <li>B&amp;B</li>
  <li>Hotels</li>
  <li>Caravan and Camping</li>
  </ol>
  
  <p>Then if you select e.g. Hotels, you are shown a UITableView of the list of hotels. The UITableView has 2 sections in it to differentiate between 3 Star and 4 Star hotels. See screen grab below.
  <img src="https://i.stack.imgur.com/ubSSW.png" alt="enter image description here"></p>
  
  <p>This is all OK so far but when I click on a cell to segue to the business' details page (a UIViewController), I segue with the wrong cell information.</p>
  
  <p>I have stepped throughout the code in my UITableViewController's didSelectRowAtIndexPath and it would seem that I am registering the correct selection on each cell.</p>
  
  <p>As an example, in the image above, if I select Ballyroe Heights Hotel, this is the output I get when stepping through it. Where dataArray() is an NSMutableArray that holds an NSMutableArray of 3 Star and an NSMutableArray of 4 Star Hotels that are added as below.</p>
  
  <pre><code>[dataArray addObject:threeStarArray];
  [dataArray addObject:fourStarArray];
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/QNDzS.png" alt="Output Image"></p>
  
  <p>However, clicking on Ballyroe Heights Hotel displays the details for Ballygarry House Hotel and Spa</p>
  
  <p>A clue to what may be going on is in the Shopping section. Below is a screen grab of what the Shopping view and sections look like.</p>
  
  <p><img src="https://i.stack.imgur.com/szObK.png" alt="enter image description here"></p>
  
  <p>Clicking on Manor West Retail Park display the correct information. But clicking on Shaws Department Store displays Manor West Retail Park again. Then clicking on Thats Perfect displays Shaws Department Store - and clicking on Sean Hussey displays Thats Perfect details. This is repeated for each section.</p>
  
  <p>Clicking on Hardware (Kellihers...) stars the display again at Manor West Retail Park.</p>
  
  <p>But again stepping through it, it seems that the correct cell is chosen in didSelectRowAtIndexPath().</p>
  
  <p>In the example below I have selected Sean Hussey and again the output shows that the correct cell was chosen and that the segue sender:selectedCell is the Sean Hussey object.</p>
  
  <p>However, the object that is passed to the UIViewController is of Thats Perfect.
  Can anyone see where I am going wrong? Additional code can be supplied but Im sure the issue has to lie here as this method checks for row selections and performs the segues.</p>
  
  <p><img src="https://i.stack.imgur.com/CxGpg.png" alt="enter image description here"></p>