ios - 将字典数组添加到字典数组

标签 ios objective-c

addingObject 之前,我在 finalOrderArray 中有两个 NSDictionary 元素。然后我添加了 sharedData.comboItems 但这个对象也是 NSDictionary 的数组。

现在,我混合使用了 NSDictionaryNSArray,这很难处理。

是否有简单的方法NSDictionary一起添加?

[finalOrderArray addObject:sharedData.comboItems];

enter image description here

此示例中的所需输出 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/

相关文章:

ios - 基于另一个属性的地幔属性类?

objective-c - 我们如何将 double 或 float 重新解释为 NSUInteger 来创建哈希?

ios - "No Challenges"消息游戏中心 iOS 8

objective-c - 如何从应用程序层次结构深处的场景回到开头?

ios - 位置管理器 :didEnterRegion method is not getting called when screen is off

ios - 以编程方式添加带有自动布局的 UITableView

ios - 从 UICollectionView 中删除单元格而不重新加载

objective-c - 如何有效地确定最常用的颜色?

objective-c - 用于iOS游戏开发的Objective-C还是ActionScript?

iOS cordova 不仅在应用程序的主屏幕上将 Disallow Overscroll 设置为 true