title: Access NSMutableArray from another class - Objective C
body: <p>I have a main <code>ViewController</code> that contains a desginated class.  Within that <code>ViewController</code> there is a <code>Container</code> that is linked to an <code>embed ViewController</code>.  Within that <code>embed ViewController</code> I am creating an <code>NSMutableArray</code>.  I am not trying to access that <code>array</code> inside the main <code>ViewController</code>.  I know that if I use:</p>
  
  <pre><code>create_challenge_peopleSelect *myScript = [[create_challenge_peopleSelect alloc] init];
  NSLog(@"%@",myScript.selectedCells);
  </code></pre>
  
  <p>The <code>NSLog</code> will output null because I am creating a new <code>ViewController</code> and that gets rid of the already set <code>array</code>.  So my question is how can I access that <code>array</code> without overwriting it?</p>
  
  <p>UPDATE:</p>
  
  <p>Heres where the <code>NSMutableArray</code> is being created:</p>
  
  <p><code>create_challenge_peopleSelect.h</code>:</p>
  
  <pre><code>@property (strong, nonatomic) NSMutableArray *selectedCells;
  </code></pre>
  
  <p><code>create_challenge_peopleSelect.m</code>:</p>
  
  <pre><code>    if([selectedCells containsObject:label.text])
      {
          cell.accessoryType = UITableViewCellAccessoryNone;
          [selectedCells removeObjectIdenticalTo:label.text];
  
      }
      else
      {
          cell.accessoryType = UITableViewCellAccessoryCheckmark;
          [selectedCells addObject:label.text];
      }
  </code></pre>
  
  <p>This class is the <code>container class</code> off the main <code>ViewController</code></p>
  
  <p>No I want to access the <code>selectedCells</code> within my main <code>ViewController</code>, I have been doing things such as:</p>
  
  <pre><code>create_challenge_peopleSelect *myScript = [[create_challenge_peopleSelect alloc] init];
  </code></pre>
  
  <p>I would prefer to stay away from the <code>App Delegate</code> If possible.</p>