NSMutableArray check if object already exists

前端 未结 9 1452
傲寒
傲寒 2020-12-25 10:17

I am not sure how to go about this. I have an NSMutableArray (addList) which holds all the items to be added to my datasource NSMutableArray.

I now

9条回答
  •  太阳男子
    2020-12-25 10:33

    NR4TR said correctly but i think one break statement is sufficient

    
    if([existingItem.iName isEqualToString:item.iName]){
                    // Do not add
    break;
                }
     

提交回复
热议问题