开发者

Printing Array with componentsJoinedByString: method

开发者 https://www.devze.com 2023-03-21 02:05 出处:网络
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:

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

精彩评论

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