NSCompoundPredicate需要注意个数,如果个数小于2个,不要使用NSCompoundPredicate,返回NSPredicate
var predicateArr = Array<NSPredicate>()
if special_file_types.contains(stringValue) {
let common = NSPredicate(format: "kMDItemFSName LIKE '*\(stringValue)'")
predicateArr.append(common)
// predicateArr.count > 1
return common
// predicateArr.count <= 1
return NSCompoundPredicate(andPredicateWithSubpredicates: predicateArr)
}