remove object from NSMutableArray
===

I have two elements:  

    NSMutableArray* mruItems;
    NSArray* mruSearchItems;

I have a `UITableView` that holds the `mruSearchItems` basically, and once the user swipes and deletes a specific row, I need to find ALL matches of that string inside the `mruItems` and remove them from there.

I haven't used NSMutableArray enough and my code gives me errors for some reason:

    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        //add code here for when you hit delete
        NSInteger i;
        i=0;
        for (id element in self.mruItems) {
            if ([(NSString *)element isEqualToString:[self.mruSearchItems objectAtIndex:indexPath.row]]) {
                
                [self.mruItems removeObjectAtIndex:i];
            }
            else
               {
                i++;
               }
        }
        [self.searchTableView reloadData];
        
    }    
}


