summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-04-19 15:06:00 -0700
committerMinh Nguyễn <mxn@1ec5.org>2018-04-19 15:06:00 -0700
commitebea67087a6f44644ade60bf419e36a6ec9a65c5 (patch)
treed3825e533a0d96c9e07a82f00da9b7a7446e78eb
parentb1840ab7beefa38bccfca2ed57fdcd1a372a59e8 (diff)
downloadqtlocation-mapboxgl-ebea67087a6f44644ade60bf419e36a6ec9a65c5.tar.gz
[ios, macos] Added Objective-C example of placeholders
-rw-r--r--platform/darwin/docs/guides/Predicates and Expressions.md6
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:",