在 addingObject
之前,我在 finalOrderArray
中有两个 NSDictionary
元素。然后我添加了 sharedData.comboItems
但这个对象也是 NSDictionary
的数组。
现在,我混合使用了 NSDictionary
和 NSArray
,这很难处理。
是否有简单的方法将NSDictionary
一起添加?
[finalOrderArray addObject:sharedData.comboItems];
此示例中的所需输出 finalOrderArray
将包含 6 个字典,而不是包含 2 个字典和一个字典数组。
最佳答案
使用 addObjectsFromArray:
方法。
Adds the objects contained in another given array to the end of the receiving array’s content.
这是 link NSMutableArray
及其所有方法。
关于ios - 将字典数组添加到字典数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45158201/