如何从2 NSMutableArray比较和删除常见对象(NSDictionaries)? [英] How to compare and remove common objects( NSDictionaries) from 2 NSMutableArray?
本文介绍了如何从2 NSMutableArray比较和删除常见对象(NSDictionaries)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个NSMutableArrays,填充字典对象,如
I have two NSMutableArrays, filled with dictionary objects, like
NSMutableArray * bigArray = @[dictionary1,dictionary2,dictionary3];
NSMutableArray * smallArray = @[dictionary1];
我想从大数组中删除公共元素(dictionay1)
I want to remove the common elements (dictionay1) from the big array
注意:小数组是大数组和元素的子集。
Note: small array is subset of big array and elements are distinct
推荐答案
[bigArray removeObjectsInArray:smallArray];
删除 bigArray
中包含的所有对象在 smallArray
。
removes all objects in bigArray
that are contained in smallArray
.
这篇关于如何从2 NSMutableArray比较和删除常见对象(NSDictionaries)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文