I trying to pass an array through prepareWithSegue but I get null when I launch the app

this is the code :

```
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.destinationViewController isEqual:@"table"]) {
        PersonsViewController *person= [[PersonsViewController alloc]init];
        [person setAnArray:anArray];

        person = segue.destinationViewController;
    }
}

```

and this is setAnArray method:

```
-(void)setAnArray:(NSMutableArray *)anArray
{
    array = [[NSMutableArray alloc]initWithArray:anArray];
    if (array != nil) {
        NSLog(@"array is copied !!");
    }
}

```

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:

```
- (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];
    } 

```

and I get array is null message.

please help me to fix this