我从URL接收数据,把它的NSDictionary,然后我需要创建的NSArray为每个标签。 我的NSDictionary的样子:
(
{
id = {
text = 1;
};
logo = {
text = "url 1";
};
name = {
text = "some name 1";
};
},
{
id = {
text = 2;
};
logo = {
text = "url 2";
};
name = {
text = "some name 2";
};
},
{
id = {
text = 3;
};
logo = {
text = "url 3";
};
name = {
text = "some name 3";
};
}
)
我想有阵列这样的:arrLogo =(@ “URL 1”,@ “URL 2”, “URL 3”)。
我在做下一个: arrName=[[dict objectForKey:@"name"] valueForKey:@"text"];
但是Xcode中给我一个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance
在我试图初始化数组的代码问题,它看起来像我的字典组成阵列。 如何正确地提取数据?