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"]
精彩评论