title: Loading a list into a NSMutableArray to populate cells of a UITableViewController
body: <p>I am building an app which contains a <code>UITableViewController</code> with a list of languages. When I click on English for example, it will load up another <code>UITableViewController</code> with a list of Videos available on a website for that language. The cells here will differ from clicking on French. So I have a Title and a URL for each video. I'm not keeping the video within the app; the user simply will click on one of the Titles and it will go to the website to play that video. </p>
  
  <p>There are about 1,100 videos, so putting this is code is quite painful. Essentially, from the <code>prepareForSegue</code>, I am calling a <code>UITableViewController</code> and will display a number of cells depending on how many there are for that language. </p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      NSIndexPath *indexPath = [self.languagesTabTableView indexPathForCell:sender];
      [self.languagesTabTableView deselectRowAtIndexPath:indexPath animated:YES];
  
      if ([segue.identifier isEqualToString:@"ShowingLeafletsAndVideosSegueChinese"])
      {
          LeafletsAndVideosTableViewController *lvtvc = (LeafletsAndVideosTableViewController*)segue.destinationViewController;
          NSMutableArray *availableLeafletsToPass = [[NSMutableArray alloc] initWithObjects:@"3 Facts",@"10 Questions",nil];
          NSMutableArray *availableVideosToPass = [[NSMutableArray alloc] initWithObjects:@"1",@"2", nil];
          NSString *theSelectedLanguage = @"Chinese";
          // Calling the set methods on the LeafletsAndVideosTableViewController
          [lvtvc setAvailableLeaflets:availableLeafletsToPass];
          [lvtvc setAvailableVideos:availableVideosToPass];
          [lvtvc setSelectedLanguage:theSelectedLanguage];
  
      }
      else if ([segue.identifier isEqualToString:@"ShowingLeafletsAndVideosSegueEnglish"])
      {
          LeafletsAndVideosTableViewController *lvtvc = (LeafletsAndVideosTableViewController*)segue.destinationViewController;
          NSMutableArray *availableLeafletsToPass = [[NSMutableArray alloc] initWithObjects:@"3 Facts",nil];
          NSMutableArray *availableVideosToPass = [[NSMutableArray alloc] initWithObjects:@"Video 1",@"Video 2", @"Video 3", @"Video 4", @"Video 5", @"Video 6", nil];
          NSString *theSelectedLanguage = @"English";
          // Calling the set methods on the LeafletsAndVideosTableViewController
          [lvtvc setAvailableLeaflets:availableLeafletsToPass];
          [lvtvc setAvailableVideos:availableVideosToPass];
          [lvtvc setSelectedLanguage:theSelectedLanguage];
      }
  </code></pre>
  
  <p>So <code>availableVideosToPass</code> is filled up with "Titles" and as long as it's not nil, it will get shown in the <code>LeafletsAndVideosTableViewController</code> without issues. What you're seeing above is just a small subset; the videos have much longer titles and actually spread across 1,100 different videos. That's 1,100 different titles. </p>
  
  <p>I'm quite new to this concept and I don't want to change this code around too much, but is there any way I can load in a file, like a text file, or a spreadsheet of titles? The English selection is always going to have the 1,100 titles, so if I could essentially load in a file into the <code>NSMutableArray</code> <code>availableVideosToPass</code>. </p>
  
  <p>If this is possible, how would I go about achieving this? I've never done anything like this before so I'm not even sure what to look for online. </p>
  
  <p>Any guidance on this would be really appreciated. </p>