diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-03-16 16:22:16 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-03-16 16:22:16 -0700 |
commit | 3ba72da74f7c768bbd20aacfe79873bf9702a26d (patch) | |
tree | 7f1d468eb585e85760bebcd32d3aec9134534a4e /platform | |
parent | 0d8b3aa5f79cb1b61ccc32d1df7c82256f78daf9 (diff) | |
download | qtlocation-mapboxgl-3ba72da74f7c768bbd20aacfe79873bf9702a26d.tar.gz |
Look inside MapboxGL.bundle when present
Fixes #1011.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/darwin/asset_root.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/darwin/asset_root.mm b/platform/darwin/asset_root.mm index 375975a84b..4dc6b58dc2 100644 --- a/platform/darwin/asset_root.mm +++ b/platform/darwin/asset_root.mm @@ -2,13 +2,22 @@ #include <mbgl/platform/platform.hpp> +@interface MGLApplicationRootBundleCanary : NSObject +@end + +@implementation MGLApplicationRootBundleCanary +@end + namespace mbgl { namespace platform { // Returns the path to the root folder of the application. const std::string &assetRoot() { static const std::string root = []() -> std::string { - NSString *path = [[[NSBundle mainBundle] resourceURL] path]; + NSString *path = [[NSBundle bundleForClass:[MGLApplicationRootBundleCanary class]] pathForResource:@"MapboxGL" ofType:@"bundle"]; + if (!path) { + path = [[[NSBundle mainBundle] resourceURL] path]; + } return {[path cStringUsingEncoding : NSUTF8StringEncoding], [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; }(); |