Clear UIWebView cache iPhone

Clear UIWebView cache iPhone

Hi, In my iPhone application ..i am using a UIWebView to load different URL on it. But i am afraid that it 's not releasing the memory. Can anyone please explain me how to load and release a UIWebView?

Thanks.

View Answers

July 5, 2011 at 4:12 PM

Generally, we release a UIWebView object into the dealloc method of the UIView ...if we create it in interface builder. But you can also create and release the UIWebView programatically.

See the code below..

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    self.iwebView = [[[UIWebView alloc]initWithFrame:exampleFrame] autorelease];
    self.iwebView.scalesPageToFit = YES;
    self.iwebView.delegate = self;
    self.iwebView.autoresizingMask = webViewBed.autoresizingMask;
    [myView addSubview:self.iwebView];
}
- (void) viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];

    [self.iwebView removeFromSuperview];
    self.iwebView.delegate = nil;
    self.iwebView = nil;
}

Ads









Related Tutorials/Questions & Answers:
Clear UIWebView cache iPhone
Clear UIWebView cache iPhone  Hi, In my iPhone application ..i am using a UIWebView to load different URL on it. But i am afraid that it 's... a UIWebView? Thanks
iPhone PDF UIWebview
iPhone PDF UIWebview  In my iPhone application i am trying to load the pdf file on UIWebview.. but some how it's not working. Please suggest. Code that i used is as follow... NSString* filePath = [[NSBundle mainBundle
Advertisements
ModuleNotFoundError: No module named 'django-clear-cache'
ModuleNotFoundError: No module named 'django-clear-cache'  Hi, My... named 'django-clear-cache' How to remove the ModuleNotFoundError: No module named 'django-clear-cache' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'wagtail-clear-cache'
ModuleNotFoundError: No module named 'wagtail-clear-cache'  Hi, My... named 'wagtail-clear-cache' How to remove the ModuleNotFoundError: No module named 'wagtail-clear-cache' error? Thanks   Hi
ModuleNotFoundError: No module named 'lru-cache-pubsub-cache-clear'
ModuleNotFoundError: No module named 'lru-cache-pubsub-cache-clear'  ...: No module named 'lru-cache-pubsub-cache-clear' How to remove the ModuleNotFoundError: No module named 'lru-cache-pubsub-cache-clear' error
Reload UIWebView
Reload UIWebView  Hi, please tell me how to reload a UIWebView in iPhone application. Thanks.   Reloading UIWebView iPhone SDK [iwebView loadRequest: [NSURLRequest requestWithURL:[NSURL URLWithString:@"http
Cleaning up the iPhone simulator
Cleaning up the iPhone simulator  How to clear cache from iPhone Simulator?   To clear cache from the iPhone simulator manually ..follow the directory path and remove all the cache from it. /Users/<username>
UIWebView Activity indicator
UIWebView Activity indicator  Can anyone please explain, how to implement a Activity Indicator on UIWebView in my iPhone/iPad application. Thanks
yum clear cache
yum clear cache In this tutorial I will tell you how you can delete the cached file by yum utility. The yum utility downloads and saves the file in cache... tool to clear cache Following command is used to to delete the package data: su
uiwebview open url in safari
uiwebview open url in safari  How to open outgoing URL like ffacebook or twitter in iPhone/iPad
Caching UIWebView
in caching? Actually, in my iPhone application i am trying to load a pdf file on UIWebView that is loading perfectly but my problem is .. it's taking a lots of time to load. Is it possible to caching the loaded file in UIWebView. And if yes
Caching UIWebView
in caching? Actually, in my iPhone application i am trying to load a pdf file on UIWebView that is loading perfectly but my problem is .. it's taking a lots of time to load. Is it possible to caching the loaded file in UIWebView. And if yes
UIWebview javascript callback
UIWebview javascript callback  HI, In my iPhone application I am loading a web page in UIWebView. There is a button on my web page. On button click... of uiwebview javascript callback. Thanks
how to create uiwebview programmatically
how to create uiwebview programmatically  How to create uiwebview programmatically in iPhone application?   Given is the code that will create the WebView programmatically in iPhone.. CGRect webFrame = CGRectMake(0.0
activity indicator for uiwebview
activity indicator for uiwebview  In my iPhone application, we required an activity indicator for uiwebview to show the loading time. Can any one please explain how to do that? Thanks in Advance
Scrolling in UIWebView
Scrolling in UIWebView  How to make an un-scroll able UIWebView
UIWebView call javascript function
UIWebView call javascript function  Hi, I am developing web browser for iPhone and iPhone devices. I want to call the java script in my html page from UIWebView. Please let's know how to call JavaScript function from objective c
UIWebView in UINavigationController
UIWebView in UINavigationController  I am wondering why application gets slow while push and pop. I have used the UINavigationController in my application. [self.navigationController popViewControllerAnimated:YES
uiwebview fit page
uiwebview fit page  How to fit the page in UIWebView in Xcode. Thanks
uiwebview zoom
uiwebview zoom  Hi, I want to zoom UIWebview programmatically. Please provide me code. Thanks   Hi, First you set the "Scales Pages to Fit" property of your webview in interface builder. Then use the following code
iphone
iphone  How can connect with the other database in iphone application(like... MYsql or oracle) is this dirctly possible
uiwebview stringbyevaluatingjavascriptfromstring example
uiwebview stringbyevaluatingjavascriptfromstring example  Hi, Can anyone share example code for using uiwebview stringbyevaluatingjavascriptfromstring function? thanks
Scrolling UIWebView JavaScript
Scrolling UIWebView JavaScript  Hi, i am looking for an example code to make a scrolling function for UIWebView in JavaScript. Thanks
open pdf in uiwebview
open pdf in uiwebview  Hi, How to open pdf in uiwebview? Thanks
UIWebView Zoom in and out
UIWebView Zoom in and out  Hi, Can anyone give me the example of tap and zoom in and out the pdf loaded on uiwebview?? Thanks
iPhone Advantages and Disadvantages
iPhone Advantages and Disadvantages       iPhone 3G Vs others: iPhone 3G Advantages and Disadvantages When the iPhone was initially launched in 2007 it was easily the most
UIWebview javascript tutorial
UIWebview javascript tutorial  Hi, How to call javascript function defined in the web page from UIWebview object? Thanks   Hi, You can use the stringByEvaluatingJavaScriptFromString function of UIWebview class
UIWebView zoom not working
UIWebView zoom not working  Hi, I don't know why UIWebView zoom not working? Tell the solution. Thanks   Hi, Open the .xib file and set scalesPageToFit to YES. Thanks
UIWebview load url
UIWebview load url  How to load website url in UIWebview? Tell me code for UIWebview load url of a website Thanks... = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [webView
browser cache
browser cache  how can we clear browser cache
iPhone
, Apple Inc had a clear winner in its hands.   iPhone... iPhone       Apple iPhone 3G is a multi-touch smartphone that has successfully combined

Ads