title: How can I access an item from an array dynamically with Swift
body: <p>I've got an Array that I'm using to populating the rows of a UITableView.</p>
  
  <p>After a row is selected I need to retrieve information from the Array based on the row selected to populate some outlets (labels, textfields, etc.)</p>
  
  <p>For example:</p>
  
  <p>I create an itemSelected variable in the <code>didSelectRowAtIndexPath</code> in my ViewController for the TableView which I set to indexPath.row</p>
  
  <pre><code>itemSelected = indexPath.row
  </code></pre>
  
  <p>Then in my viewDidLoad for my otherViewController I need to retrieve the info by </p>
  
  <pre><code>array[itemSelected]
  </code></pre>
  
  <p>But, I get a compiler error that says: "Expression resolves to unused i-value"</p>