title: Initialising a UIImageView with a different image depending on a variable
body: <p>I have a UITableView with some cells. When a cell is tapped, I set a string variable called Index to the index of the cell that was tapped. I have verified that this is working with an NSLog of Index from my UIImageView's controller. Now, what I'm trying to do is set the image of a UIImageView to an image corresponding to the cell tapped (i.e. a different image for each cell). The way I'm trying to do this (it doesn't work) is with this code in my UIImageView's controller's ViewDidLoad method:</p>
  
  <pre><code>if ([[TableViewController alloc] Index] isEqualToString:@"0"]) {
     Display.image = [UIImage imageNamed:@"0.jpg"]; 
  }  
  </code></pre>
  
  <p>'Display' is the name of my UIImageView.
  Is this code correct? If it is, where should I put it so that when I tap the first cell my UIImageView initialises with the image called "0.jpg"?</p>