summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-07-20 17:18:44 -0400
committerJason Wray <jason@mapbox.com>2018-07-20 17:20:51 -0400
commita5e1a82bc96976ef81c689449656d159935e9e6b (patch)
tree36f8ace8c1c6a5199861e23e134a6969a392519a
parent7e5b0545665f349c842d46c5e8eae7595ca5f89b (diff)
downloadqtlocation-mapboxgl-upstream/fb-12432-reproduction.tar.gz
Reproduction for #12432i [skip-ci]upstream/fb-12432-reproduction
Tap the style name in the navigation bar to switch styles... and crash.
-rw-r--r--platform/ios/app/MBXViewController.m52
1 files changed, 22 insertions, 30 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 167f07d296..c945f342e7 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1859,41 +1859,33 @@ CLLocationCoordinate2D randomWorldCoordinate() {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
styleNames = @[
- @"Streets",
- @"Outdoors",
- @"Light",
- @"Dark",
- @"Satellite",
- @"Satellite Streets",
+ @"Desert Planet",
+ @"Terminal",
];
styleURLs = @[
- [MGLStyle streetsStyleURL],
- [MGLStyle outdoorsStyleURL],
- [MGLStyle lightStyleURL],
- [MGLStyle darkStyleURL],
- [MGLStyle satelliteStyleURL],
- [MGLStyle satelliteStreetsStyleURL]
-
+ [NSURL URLWithString:@"mapbox://styles/mapbox/cj6o7atdb1dbd2rpq8ztesezs"],
+ [NSURL URLWithString:@"mapbox://styles/mapbox/cj62n87yx3mvi2rp93sfp2w9z"],
+ //[MGLStyle streetsStyleURL],
];
NSAssert(styleNames.count == styleURLs.count, @"Style names and URLs don’t match.");
- // Make sure defaultStyleURLs is up-to-date.
- unsigned numMethods = 0;
- Method *methods = class_copyMethodList(object_getClass([MGLStyle class]), &numMethods);
- unsigned numStyleURLMethods = 0;
- for (NSUInteger i = 0; i < numMethods; i++) {
- Method method = methods[i];
- if (method_getNumberOfArguments(method) == 3 /* _cmd, self, version */) {
- SEL selector = method_getName(method);
- NSString *name = @(sel_getName(selector));
- if ([name hasSuffix:@"StyleURLWithVersion:"]) {
- numStyleURLMethods += 1;
- }
- }
- }
- NSAssert(numStyleURLMethods == styleNames.count,
- @"MGLStyle provides %u default styles but iosapp only knows about %lu of them.",
- numStyleURLMethods, (unsigned long)styleNames.count);
+// // Make sure defaultStyleURLs is up-to-date.
+// unsigned numMethods = 0;
+// Method *methods = class_copyMethodList(object_getClass([MGLStyle class]), &numMethods);
+// unsigned numStyleURLMethods = 0;
+// for (NSUInteger i = 0; i < numMethods; i++) {
+// Method method = methods[i];
+// if (method_getNumberOfArguments(method) == 3 /* _cmd, self, version */) {
+// SEL selector = method_getName(method);
+// NSString *name = @(sel_getName(selector));
+// if ([name hasSuffix:@"StyleURLWithVersion:"]) {
+// numStyleURLMethods += 1;
+// }
+// }
+// }
+// NSAssert(numStyleURLMethods == styleNames.count,
+// @"MGLStyle provides %u default styles but iosapp only knows about %lu of them.",
+// numStyleURLMethods, (unsigned long)styleNames.count);
});
self.styleIndex = (self.styleIndex + 1) % styleNames.count;