title: Passing data between View Controllers using prepareForSegue
body: <p>I'm trying to create a simple project to pass some data between two view controllers which I have set up using storyboarding.</p>
  
  <p>The project is very simple - on the first page I have a text field, and then a button takes the user to a second view controller where the text should hopefully be displayed, but as of yet no luck.</p>
  
  <p>I am using the 'Modal' style for the Segue, here is the code:</p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
  ViewController2 *vc2;
  
  vc2 = [segue destinationViewController];
  
  vc2.label.text = textField.text;    
  </code></pre>
  
  <p>}</p>
  
  <p>I would be grateful if someone could help me out with the correct code and explain to me why what I currently have doesn't work.  I've searched around, and while there seem to be several variations as to how this can be done, this seems pretty much correct to me.</p>
  
  <p>I only moved to iOS from the console about two weeks ago, so please keep it simple!</p>
  
  <p>Thanks in advance!</p>