Question

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

Was it helpful?

Solution

Try This

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

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

OTHER TIPS

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

[[NSURLCache sharedURLCache] removeAllCachedResponses];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top