Q:

NSMutableArray removeAllObjects issue

I am trying to remove all the objects from the NSMutableArray and I am reloading the UITableView. But it produces SIGABRT in cellForRowAtIndexPath. The code is given below. 
if ([nsMutableArray count] != 0) {

        [nsMutableArray removeAllObjects];
        [tableView reloadData];
    }

It shows SIGABRT in 
if (cell == nil) {

        cell = (UICustomCell *)[nsMutableArray objectAtIndex:indexPath.row];
    }

Help me to come out of this problem.

A:

change this 
to
if ([NSMutableArrayObject count] != 0) {
   [NSMutableArrayObject removeAllObjects];
   [tableView reloadData];
}

if (cell == nil) {
    cell = (UICustomCell *)[NSMutableArrayObject objectAtIndex:indexPath.row];
}

