title: Passing an array with prepareforsegue
body: <p>I trying to pass an array through prepareWithSegue but I get null when I launch the app</p>
  
  <p>this is the code :</p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if ([segue.destinationViewController isEqual:@"table"]) {
          PersonsViewController *person= [[PersonsViewController alloc]init];
          [person setAnArray:anArray];
  
          person = segue.destinationViewController;
      }
  }
  </code></pre>
  
  <p>and this is setAnArray method:</p>
  
  <pre><code>-(void)setAnArray:(NSMutableArray *)anArray
  {
      array = [[NSMutableArray alloc]initWithArray:anArray];
      if (array != nil) {
          NSLog(@"array is copied !!");
      }
  }
  </code></pre>
  
  <p>the data should pass from viewController(embedded with UINavigation Controller) to PersonViewController (which is tableview) and nothing shows on the table so I NSLogged the the array count and found it zero so I did some further checking with this code:</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  #warning Incomplete method implementation.
      // Return the number of rows in the section.
      if (array == nil) {
          NSLog(@"array is null");
      }
      else
      {
          NSLog(@"array count is %lu",(unsigned long)[array count]);
          return [array count];
      } 
  </code></pre>
  
  <p>and I get array is null message.</p>
  
  <p>please help me to fix this</p>