我试图将nsindexpath添加到数组中,但我只能添加一个indexpath。如果我尝试将另一个indexpath添加到数组中,调试器只会显示最新的indexpath。
即使我试图将
for (int i = 0 ; i<[notificationArray count]; i++)
{
selectedSymptIndexPath = [NSIndexPath indexPathForRow:selectedSymptomIndex inSection:keyIndexNumber];
selectedSympIPArray = [[NSMutableArray alloc]init];
[selectedSympIPArray addObject:selectedSymptIndexPath];
}
即使我试图将
[selectedSympIPArray addObject:selectedSymptIndexPath];
放在 for 循环之外,它仍然只添加最新的 indexPath 而不是显示多个 indexPath。