title: Delegates in Xcode 7, iOS9
body: <p>First of all, I am not Objective-c developer, however I have 4 years of experience in C and C++.</p>
  
  <p>I am trying to make a few demo programs for an (iPad) app camp. For one of these programs I want to pass data between two <code>UIViewControllers</code>. </p>
  
  <p>I have tried various examples, among the example below.
  <a href="https://stackoverflow.com/questions/5210535/passing-data-between-view-controllers?page=2&amp;tab=votes#tab-top">Passing Data between View Controllers</a></p>
  
  <p>The code is written in an older version of Xcode so I took a bit of tweaking to get it through the compiler. Now I am facing the following problems:</p>
  
  <ul>
  <li><p>It seems the <code>prepareForSegue</code> is not being called when I open a new view? (Or am I doing something wrong?) I have tried various ways.</p></li>
  <li><p>In the same post there is a way to pass a delegate to a new class and back to the calling class. When I run this all goes good but there is the last part:</p></li>
  </ul>
  
  <p>In <code>ViewControllerA.m</code> implement the following method from our protocol</p>
  
  <pre><code>(void)addItemViewController:(ViewControllerB *)controller didFinishEnteringItem:(NSString *)item
  {
      NSLog(@"This was returned from ViewControllerB %@",item);
  }
  </code></pre>
  
  <p>Does net execute... I have no idea what is wrong. I followed the example exactly. I can see the second view opening and closing, only the delegate code won't run. Do I have to do this in a different way in Xcode 7? </p>
  
  <p>P.S. I know this is a basic question but I cant seem to find the answer or a good Xcode 7 guide anywhere.</p>