質問

In my app.I have a one textfield and one search button.when it user click on search button after fill up the address on textfield my app shows the result and place a pin on mapview. I am using google maps api for it. I have also added the functionality user can drag and drop the pin. when the user drag the pin and drop on another place.The previous pin should be removed.For removing that pin i am using [mapView removeAnnotation[mapView.annotations lastObject]];

but when i again search a new address which is already search.It again created a new pin. I know this is coming from cache of mkmapview. **Now how can i remove it(pin) from mkmapview

役に立ちましたか?

解決

Try This

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

[NSURLCache setSharedURLCache:sharedCache];
 [sharedCache release];

他のヒント

Just to update, since I was looking for this. Seems a bit cleaner

[[NSURLCache sharedURLCache] removeAllCachedResponses];
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top