title: How to pass a value to parent view controller?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6203799/dismissmodalviewcontroller-and-pass-data-back">dismissModalViewController AND pass data back</a>  </p>
  </blockquote>
  
  
  
  <p>I'm new to ios development and stuck on this problem:</p>
  
  <p>I'm using storyboarding and have a navigation controller, <code>vcA</code>, with a <code>TableView</code> in it which shows some data from a <code>MutableArray</code> (which is initialized in <code>viewdidload</code> of the same class). After selecting any cell, a second view controller, <code>vcB</code>, is shown with a <code>TextField</code> in it and a button called "Add to list".</p>
  
  <p>What I want is that when I enter some text in the <code>TextField</code> and press the "Add to list" button the text should be added to the array of previous view (which gets shown in the <code>TableView</code>) and when i tap the "Back" button on <code>vcB</code>'s navigation bar, <code>vcA</code> should show the updated <code>TableView</code> with the new entry in it (on the top of list). Basically I want to add the text from <code>vcB</code>'s <code>TextField</code> to the array of <code>vcA</code> and show the new array after clicking the BACK button.</p>
  
  <p>I have searched a lot about this issue and seem to find that delegate and protocols is the way to achieve the desired result but I'm having trouble understanding delegation.</p>