Objective c 如何筛选没有';不包含字符串?

Objective c 如何筛选没有';不包含字符串?,objective-c,ios,cocoa-touch,Objective C,Ios,Cocoa Touch,我有NSMutableArray和NSString对象。 如何对其进行过滤以仅获取不包含字符串的对象? 我尝试NSPredicate筛选包含字符串的对象: NSString *match = @"My text"; NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", match]; [self.filesList setArray:[self.filesLis

我有NSMutableArray和NSString对象。 如何对其进行过滤以仅获取不包含字符串的对象? 我尝试NSPredicate筛选包含字符串的对象:

NSString *match = @"My text"; 

    NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", match];

    [self.filesList setArray:[self.filesList filteredArrayUsingPredicate:sPredicate]];
有没有类似的东西,但要过滤它,反之亦然?某些类型的“!contains”

请改用此选项:


NSPredicate*sprediate=[NSPredicate predicateWithFormat:@“非(自身包含[cd]]@)”,匹配]

可能重复感谢!它起作用了!此外,还可以通过使用包含字符串的对象创建一个新数组,然后使用removeObjectsInArray来完成