Finding Intersection of NSMutableArrays

前端 未结 5 1913
广开言路
广开言路 2020-11-28 09:30

I have three NSMutableArray containing names that are added to the lists according to different criterieas.

Here are my arrays pseudocode:

NSMutableA         


        
5条回答
  •  醉话见心
    2020-11-28 10:29

    Here is a working variant from links above

    NSPredicate *intersectPredicate = [NSPredicate predicateWithFormat:@"SELF IN %@", @[@500, @400, @600]];
    NSArray *intersect = [@[@200, @300, @400] filteredArrayUsingPredicate:intersectPredicate];
    

提交回复
热议问题