Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要合并两个 nsmutablearrays 字典,但我的问题是有没有办法删除重复的字典?
我会非常感谢你的帮助。
实际上,如果您不关心顺序,请使用 NSMutableSet 过滤重复项:
NSMutableSet *set = [NSMutableSet set]; for (id item in arr1) { [set addObject:item]; } for (id item in arr2) { [set addObject:item]; }
然后,您可以获得一组独特的物品。