title: Not able to access NSMutableArray from another class
body: <p>I've read through many posts here but I can't seem to make my array available in another class.</p>
  
  <p>I want to access the array plusTransactions in CPPHistoryViewController (a table controller, in a container as a child of CPPSecondViewController) from class CPPSecondViewController.</p>
  
  <p>CPPSecondViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  @interface CPPSecondViewController : UIViewController &lt;UIWebViewDelegate&gt;
  @property (weak, nonatomic) IBOutlet UIWebView *webView;
  @property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedController;
  @property (weak, nonatomic) NSMutableArray *plustransactions;
  @property (weak, nonatomic) NSMutableArray *campustransactions;
  @property (weak, nonatomic) NSMutableArray *mealtransactions;
  
  @end
  </code></pre>
  
  <p>CPPSecondViewController.m</p>
  
  <pre><code>#import "CPPSecondViewController.h"
  @interface CPPSecondViewController ()
  @implementation CPPSecondViewController
  @end
  
  @synthesize plustransactions = _plustransactions;
  @synthesize campustransactions = _campustransactions;
  @synthesize mealtransactions = _mealtransactions;
  
  ...
  
  _plustransactions = newPlustransactions;
  NSLog(@"%@", newPlustransactions);
  NSLog(@"%@%lu", @"That's how many: ", (unsigned long)_plustransactions.count);
  CPPHistoryViewController *historyView = [[CPPHistoryViewController alloc]init];
  [historyView.tableView reloadData];
  </code></pre>
  
  <p>This is good, returns all of my array items and count is 7.</p>
  
  <p>CPPHistoryViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface CPPHistoryViewController : UITableViewController &lt;UITableViewDelegate, UITableViewDataSource&gt;
  @end
  </code></pre>
  
  <p>CPPHistoryViewController.m</p>
  
  <pre><code>#import "CPPHistoryViewController.h"
  #import "CPPSecondViewController.h"
  #import "CPPPlusTransaction.h"
  #import "CPPCampusTransaction.h"
  #import "CPPMealTransaction.h"
  #import "CPPHistoryCell.h"
  
  @interface CPPHistoryViewController ()
  
  @end
  
  @implementation CPPHistoryViewController
  
  ...
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      // Return the number of rows in the section.
      CPPSecondViewController *secondView = [[CPPSecondViewController alloc] init];
      NSMutableArray *plusTransactions = [[NSMutableArray alloc]init];
      plusTransactions = secondView.plustransactions;
      NSMutableArray *campusTransactions = [[NSMutableArray alloc]init];
      campusTransactions = secondView.campustransactions;
      NSMutableArray *mealTransactions = [[NSMutableArray alloc]init];
      mealTransactions = secondView.mealtransactions;
      NSLog(@"Table formatting called");
      NSLog(@"%ld", (long)secondView.segmentedController.selectedSegmentIndex);
      switch (secondView.segmentedController.selectedSegmentIndex) {
          case 0:
              NSLog(@"%@%lu", @"PlusTransactions", (unsigned long)plusTransactions.count);
              return plusTransactions.count;
              break;
          case 1:
              NSLog(@"%@%lu", @"CampusTransactions", (unsigned long)campusTransactions.count);
              return campusTransactions.count;
              break;
          case 2:
              NSLog(@"%@%lu", @"MealTransactions", (unsigned long)mealTransactions.count);
              return mealTransactions.count;
              break;
      }
      return 1;
  }
  
  ...
  
  @end
  </code></pre>
  
  <p>Here's where things get weird. Any array I call from here returns with a count of 0. Any ideas?</p>