Saturday, November 13, 2010 [Tweets] [Favorites]

Abusing NSPredicate

Dave DeLong:

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

1 Comment

[...] abusing NSPredicate, Dave DeLong has moved on to writing his own parser in Objective-C. Number handling is via [...]

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment