i'm trying to release UIWebView object but it not free memory. is it have any reason?
+2
A:
Maybe clearing the cache might help? See NSURLCache
class.
Diederik Hoogenboom
2010-02-02 14:43:34
thanks for your suggestion Diederik
RAGOpoR
2010-02-02 17:09:10
cound you show me some example to clear cache?
RAGOpoR
2010-02-02 17:33:54
[[NSURLCache sharedURLCache] removeAllCachedResponses];
Diederik Hoogenboom
2010-02-02 19:03:41
i try your code but it not free memory. thanks for your reply
RAGOpoR
2010-02-03 04:41:01
+1
A:
Hi,
Just because you've released it doesn't mean that it can be released - maybe it's being used by something else?
What is it's retain count after you have freed it?
[myWebView release];
NSLog(@"%i", [myWebView retainCount]);
If this number is not 0, someone else is retaining it as well and it can't be freed until they release it too (or it's set to be autoreleased so it will vanish at some point in the future).
Another possibility is that the memory used is in some sort of shared library that gets loaded when a web view is created - you'll probably get no control of how to unload that.
Sam
PS I'm assuming that you've also done [myWebView removeFromSuperview];
- adding yourself to a view will retain you.
deanWombourne
2010-02-02 15:08:36