Convert search terms into NSExpressions and assemble them into NSComparisonPredicates, which are then combined into a NSCompoundPredicate. This is preferable to building up format strings because it completely sidesteps the need to worry about escaping any special characters.
I also switched to using NSNumberFormatter to parse integers and floating point values from strings. This avoids having a search term of "1.2" match any integer column with a value of 1, which seemed like confusing behavior. It also results in more consistent handling of whitespace around numbers, which previously differed between zero and non-zero values (" 0" would be ignored, while " 1" would be respected).
Convert search terms into
NSExpression
s and assemble them intoNSComparisonPredicate
s, which are then combined into aNSCompoundPredicate
. This is preferable to building up format strings because it completely sidesteps the need to worry about escaping any special characters.I also switched to using
NSNumberFormatter
to parse integers and floating point values from strings. This avoids having a search term of "1.2" match any integer column with a value of 1, which seemed like confusing behavior. It also results in more consistent handling of whitespace around numbers, which previously differed between zero and non-zero values (" 0" would be ignored, while " 1" would be respected).I've only lightly tested this.
Fixes #313.