In xcode 9 with iOS 11 - issue with loading of Map tiles on first run

前端 未结 4 2098
孤城傲影
孤城傲影 2021-02-13 12:53

--Updated with new findings -- Tested in both simulator and on device. Maps are not loaded correctly when the app is run from a cold start. Tiles are not being displayed.

<
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-13 13:47

    Make sure you are not using dispatch_async for the map.

    I had the following function that did not work in iOS11

    dispatch_async(dispatch_get_main_queue(), ^{
        @synchronized(_queue) {
            if(poppedMapView != nil) {
                [self.queue removeObject:poppedMapView];
            }
            [self.queue addObject:[[MKMapView alloc] init]];
        }
    });
    

    Changed it to

    if(poppedMapView != nil) {
        [self.queue removeObject:poppedMapView];
    }
    [self.queue addObject:[[MKMapView alloc] init]];
    

提交回复
热议问题