如何在数组中添加Dictionary?

时间:2015-10-01 07:43:52

标签: ios

2015-10-01 12:05:32.073 arrayss[1206:30600]  elements in  array= (
    ramki,
        (
        ramakrishna,
        praveen,
        prabhakar,
        ramu,
        ravi
    ),
    name,
        {
        name1 = ramki;
        name2 = praveen;
        name3 = prabhakar;
        name4 = ramu;
        name5 = ravi;
    },
    Employee
)

我想打印

{
(
        name1 = ramki;
        name2 = praveen;
        name3 = prabhakar;
        name4 = ramu;
        name5 = ravi;
)
},
像这样帮助我

1 个答案:

答案 0 :(得分:0)

你需要:

[myArray addObjectsFromArray:[dict objectForKey:@"Added"]];

我建议您学习使用该文档,因为NSArray文档中已明确说明了这一点。

另一方面,如果要将整个字典添加到数组中,可以使用:

[myArray addObjects:youDictionary];