summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSExpression+MGLAdditions.mm
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-09-01 06:48:36 -0700
committerFredrik Karlsson <bjorn.fredrik.karlsson@gmail.com>2016-09-02 22:42:48 +0200
commit7e208c46cebe5b49d4b7ead9826bbe4229ebabd3 (patch)
tree6b68b5956a8292a72e95cd80d7e08c8e1346407b /platform/darwin/src/NSExpression+MGLAdditions.mm
parentd77a13eb7320722c48c8a18240adf99615c4b85f (diff)
downloadqtlocation-mapboxgl-7e208c46cebe5b49d4b7ead9826bbe4229ebabd3.tar.gz
[ios] Check for bool value with char
We convert NSNumbers (and NSStrings) to the appropriate mbgl value so that we can use NSPredicates to describe mbgl filters we want to apply to style layers at runtime. This change fixes an issue where the conversion from an NSNumber that represented a bool was not recognized as such. encode(bool) returns a 'c' or 'b' on 32 bit and 64 bit systems respectively and objCType of an NSNumber representing a bool always returns 'c'. Now the implementation checks for 'c' always and NSNumbers representing bool don't fall through and trigger the exception.
Diffstat (limited to 'platform/darwin/src/NSExpression+MGLAdditions.mm')
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index 5f1a1e765a..129c9a740c 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -31,7 +31,7 @@
return { number.intValue };
} else if ((strcmp([number objCType], @encode(double))) == 0) {
return { number.doubleValue };
- } else if ((strcmp([number objCType], @encode(bool))) == 0) {
+ } else if ((strcmp([number objCType], @encode(char))) == 0) {
return { number.boolValue };
}
}