diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-04-19 15:06:00 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-04-19 15:06:00 -0700 |
commit | ebea67087a6f44644ade60bf419e36a6ec9a65c5 (patch) | |
tree | d3825e533a0d96c9e07a82f00da9b7a7446e78eb | |
parent | b1840ab7beefa38bccfca2ed57fdcd1a372a59e8 (diff) | |
download | qtlocation-mapboxgl-ebea67087a6f44644ade60bf419e36a6ec9a65c5.tar.gz |
[ios, macos] Added Objective-C example of placeholders
-rw-r--r-- | platform/darwin/docs/guides/Predicates and Expressions.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md index 89e4983b9c..df4d2fc249 100644 --- a/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/darwin/docs/guides/Predicates and Expressions.md @@ -130,6 +130,12 @@ expression format string of `lowercase(ISO 3166-1:2006)` or a predicate format string of `ISO 3166-1:2006 == 'US-OH'` would raise an exception. Instead, use a `%K` placeholder or the `+[NSExpression expressionForKeyPath:]` initializer: +```objc +[NSPredicate predicateWithFormat:@"%K == 'US-OH'", @"ISO 3166-1:2006"]; +[NSExpression expressionForFunction:@"lowercase:" + arguments:@[[NSExpression expressionForKeyPath:@"ISO 3166-1:2006"]]] +``` + ```swift NSPredicate(format: "%K == 'US-OH'", "ISO 3166-1:2006") NSExpression(forFunction: "lowercase:", |