Swift combining predicates LogicalType AND OR
问题 How can i combine a mix AND OR condition in Swift predicate. I have a following query Select * from tblTemp where dept == 1 && (subdept == 11 || subdept == 12) I can write two predicate with same operator but don't know how to combine them let deptPredicate = NSPredicate(format: "dept == %@", 1) let subdeptPredicate1 = NSPredicate(format: "subdept = %@", 11) let subdeptPredicate2 = NSPredicate(format: "subdept = %@", 12) let andPredicate = NSCompoundPredicate(type: NSCompoundPredicate