How can I clear MKMapView's cache of map tiles?

后端 未结 3 1232
暖寄归人
暖寄归人 2020-12-18 02:01

I am working on an MKMapView based iPhone / iPad mapping app that overlays my own basic base map to provide for some limited functionality even when users are offline and ca

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 02:34

    Try setting NSURLConnection cache size to zero before creating any instance of your MKMapView

        NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
    [NSURLCache setSharedURLCache:sharedCache];
    [sharedCache release];
    

    This might make your connections stop storing cached data as the cache remaining size will always be insufficient

提交回复
热议问题