获取两个 NSDictionary 项的互斥键
我有两个不同的 NSDictionary 对象,其中有属于两个集合的键,而有些键仅出现在第一个字典中,类似地,在第二个字典中找不到几个键,但在第一个字典中却找不到。
有没有一种有效的方法来进行集合比较,以提取第一个字典中存在但第二个字典中不存在的键?
基本上,在标准维恩图中,集合 A 的元素与集合 B 不相交。
I have two different NSDictionary objects where there are keys that belong to both collections while there are some keys present only in the 1st dictionary and similarly, few keys are found in the 2nd dictionary but not in the 1st.
Is there an efficient way to do a set comparison to extract the keys present in the 1st dictionary that do not exist in the 2nd?
Basically, in the standard Venn diagram, the elements of Set A that do not intersect with Set B.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
NSSet
是您正在寻找的:NSSet
is what you're looking for: