One of the best things about
NSPredicateis its parsing engine. Given a well-formatted
NSPredicatewill turn it into a tree of
NSComparisonPredicateobjects. This can be used to our advantage. If we have a string that represent some boolean expression, we can tap
NSPredicateto parse it for us and give us back an organized syntax tree.