(
{
iReplyId = 3870;
name = rahul;
},
{
iReplyId = 3914;
name = Tom;
},
{
iReplyId = 3873;
name = Smith;
},
{
iReplyId = 3871;
name = yator;
},
{
iReplyId = 3872;
name = jack;
},
{
iReplyId = 3875;
name = smith;
},
{
iReplyId = 3876;
name = rancho;
},
{
iReplyId = 3878;
name = vid;
},
)
我的要求是使用nspredicate过滤此数组,如iReplyId = 3871,3870,3914这样的多重条件。我尝试了很多,但我没有得到谓词的解决方案,我可以通过使用for循环解决这个问题,但这不是一个好方法。 任何帮助都非常感谢。
答案 0 :(得分:0)
[array filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"iReplyId IN (%@)",[idsArray componentsJoinedByString:@","]]]