我有一个包含以下内容的可变数组:
2012-05-26 23:38:09.606 [8147:f803] log (
{
send = david;
receive = mike;
message = test me;
},
{
send = david;
receive = daddy;
message = test me;
},
{
send = david;
receive = daddy;
message = test me;
}
)
我发现这样的重复值:
NSSet *uniquearray = [[NSSet alloc] init];
uniquearray = [[NSSet setWithArray: myArray] valueForKey:@"receive"];
2012-05-26 23:38:09.609 [8147:f803] log (
mike,
daddy
)
但是,如果我想检索消息,我该怎么做呢?我只想要像 take 之类的东西(也许重建一个 nsarray)
2012-05-26 23:38:09.609 [8147:f803] log (
{
receive = mike,
message = test me;
},
{
receive = daddy
message = test me;
})
谢谢。