title: How to pass data back from one view to other View in IOS?
body: <p>I am able to pass data from one view to other view without any problem. But here is my situation i am facing problem.</p>
  
  <p>Let's say
          <strong>->   Passing data to other view</strong></p>
  
  <pre><code>ViewA-&gt;ViewB This working perfectly fine 
  ViewB-&gt;ViewC This working perfectly fine
  ViewC-&gt;ViewB Here is the problem.
  </code></pre>
  
  <p>I tried using <strong>push segue</strong> ,it goes to ViewB but when i press back button it goes to <strong>ViewC->back button->ViewB->back button->View A. From ViewB when i press back button it must goes to ViewA.</strong></p>
  
  <p>Tried using <strong>modal segue</strong>, it goes to ViewB but then i can't go any where.</p>
  
  <p><strong>As i am new to iOs I am really haven't got any idea about how to achieve this?</strong></p>
  
  <p><strong>How to pass data back to ViewB from ViewC?</strong></p>
  
  <p>I think you guys can help me.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>In View A i am calling ViewB like this</p>
  
  <pre><code>-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
  if([segue.identifier isEqualToString:@"RemixScreen"])
  {
  
      if([self.recipeFrom isEqualToString:@"ViewB"])
      {
  
          ViewB *reciepe = [segue destinationViewController];
          //somedata i will pass here
  
      }  
  }
   }
  </code></pre>
  
  <p>In View B i am calling like this</p>
  
  <pre><code>-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
  if([segue.identifier isEqualToString:@"ViewA"])
  {  
      ViewA *data = [segue destinationViewController];
      //some data  
  }
  }
  </code></pre>
  
  <p>Thanks for your help guys.</p>