开发者

Printing Array with componentsJoinedByString: method

Hey guys im using the method above like:

string = [array componentsJoinedByString:@"\n"];

this prints out each obj in my array, but what it prints out is:

{
Selected = 0;
name = "boots";
number = 69;
}
{
Selected = 0;
name = house;
nu开发者_JAVA百科mber = 1001;
}
}
Selected = 0;
name = shirt;
number = 1234;
}
{
Selected = 0;
name = Brewski;
number = 4567;
}



 and i just want it to print out:

 Brewski
 Boots...

etc.. 


The objects in your array seem to be dictionaries. You should do this instead.

[[array valueForKey:@"name"] componentsJoinedByString:@"\n"]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜