title: Method in RootViewController not Storing Array
body: <p>I have an array initialized in my RootViewController and a method that addsObjects to an array. I created a RootViewController object in my SecondViewController.  The method runs (outputs a message) but it doesn't add anything to the array, and the array seems empty.  Code is below, any suggestions?</p>
  
  <p>RootViewController.h</p>
  
  <pre><code>#import "RootViewController.h"
  #import "SecondViewController.h"
  
  @implementation RootViewController
  - (void)viewDidLoad {
      [super viewDidLoad];
      myArray2 = [[NSMutableArray alloc] init];
  
      NSLog(@"View was loaded");
  }
  -(void)addToArray2{
      NSLog(@"Array triggered from SecondViewController");
      [myArray2 addObject:@"Test"];
      [self showArray2];
  }
  
  -(void)showArray2{
      NSLog(@"Array Count: %d", [myArray2 count]);
  }
  -(IBAction)switchViews{
      SecondViewController *screen = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
      screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
      [self presentModalViewController:screen animated:YES];
      [screen release];
  }
  </code></pre>
  
  <p>SecondViewController.m</p>
  
  <pre><code>#import "SecondViewController.h"
  #import "RootViewController.h"
  
  @implementation SecondViewController
  
  -(IBAction)addToArray{
  
      RootViewController *object = [[RootViewController alloc] init];
      [object addToArray2];
  
  }
  -(IBAction)switchBack{
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>EDIT*************</p>
  
  <p>With Matt's code I got the following error:</p>
  
  <p>" expected specifier-qualifier-list before 'RootViewController' "</p>