title: How to pass data viewcontroller via Tab bar Controller
body: <p>I want to pass datum from view controller to view controller via tab bar controller.</p>
  <p>I mean, my storyboard is like this.</p>
  <pre><code>View Controller → Tab Bar Controller → VC1/VC2/VC3
  </code></pre>
  <p>For the purpose of this, I tried to use <code>PrepareforSegue</code>, but it's failed.<br />
  The code is here.</p>
  <pre><code>(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
  NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow];
  friendsDetailViewController* vc = [[friendsDetailViewController alloc] init];
  vc = (friendsDetailViewController*)[segue destinationViewController];
   
  vc.candidateid = [[NSString alloc] init];
  vc.candidateid = [candidateid objectAtIndex:selectedIndexPath.row];
  </code></pre>
  <p>Though I was trying to pass data from VC to VC1, <code>SIGABT</code> happened on the last line.</p>
  <hr />
  <h3>Update:</h3>
  <p>I've got figured out how. Here is the script:</p>
  <pre><code>friendsDetailViewController* vc = [[friendsDetailViewController alloc] init];
  UITabBarController* tbc = [segue destinationViewController];
  vc = (friendsDetailViewController*)[[tbc customizableViewControllers] objectAtIndex:0];
  </code></pre>
  <p>Firstly, I have to attach Tab Bar Controller.<br />
  Secondly, retrieve each View Controller's pointer.<br />
  You can select by using objectIndex.</p>