Abusing NSPredicate
One of the best things about
NSPredicateis its parsing engine. Given a well-formattedNSString,NSPredicatewill turn it into a tree ofNSCompoundPredicateandNSComparisonPredicateobjects. This can be used to our advantage. If we have a string that represent some boolean expression, we can tapNSPredicateto parse it for us and give us back an organized syntax tree.
1 Comment
Stay up-to-date by subscribing to the Comments RSS Feed for this post.
[...] abusing NSPredicate, Dave DeLong has moved on to writing his own parser in Objective-C. Number handling is via [...]