-2
(
        {
        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 循环来解决这个问题,但这不是一个好方法。非常感谢任何帮助。

4

1 回答 1

0
[array filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"iReplyId IN (%@)",[idsArray componentsJoinedByString:@","]]]
于 2013-05-13T07:07:51.293 回答