如何清除mkmapview的caching

在我的应用程序中,我有一个文本框和一个searchbutton。当用户点击searchbutton后填充文本字段上的地址我的应用程序显示结果,并在地图视图上放置一个pin。 我正在使用谷歌地图API。 我还添加了用户可以拖放的function。 当用户拖动引脚,并放在另一个地方。以前的引脚应该被删除。为了去除这个引脚,我正在使用[mapView removeAnnotation [mapView.annotations lastObject]];

但是当我再次search一个已经search的新地址时,它又创build了一个新的引脚。 我知道这是来自mkmapview的caching。 **现在我怎么能从mkmapview中删除它(pin)

尝试这个

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

只是为了更新,因为我正在寻找这个。 似乎有点干净

 [[NSURLCache sharedURLCache] removeAllCachedResponses];