title: Passing Data to Tabbar Controller
body: <p>I have a storyboard project and I would like to pass some data from a view into a tab bar controller, the information will be spread out between the tabs. After doing some research I found a very similar issue: <a href="https://stackoverflow.com/questions/8429088/ios-storyboard-passing-data-navigationviewcontroller">iOS storyboard passing data navigationViewController</a> but the only issue with this solution is that it was not transferring to a tab bar controller. I was wondering would I have to pass the data to each tab or can I pass it to the tab bar controller and then spread it from there? Thank you for your help in advance!</p>
  
  <p>I am currently using the following; but, I get an error:</p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
       if ([segue.identifier isEqualToString:@"FoodPage"]) {
      NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
      UINavigationController *nav = [segue destinationViewController];
      FoodViewController *destViewController = (FoodViewController*) nav.topViewController;
      destViewController.Foods = [foodArray objectAtIndex:indexPath.row];
    }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/UPJhz.png" alt=""></p>