Note that there are some explanatory texts on larger screens.

plurals
  1. PORelease UIWebView content from the memory, force the app to release the memory
    text
    copied!<p>I'm developing an app that use a lot of images, I'm using the <code>UIWebView</code> to represent about 200 image using JavaScript code (i'm using <a href="http://www.uize.com/" rel="nofollow">UIZE</a> library), the problem is when i'm done with the <code>UIWebView</code>, i'm using the following code in the <code>viewWillDisappear</code></p> <pre><code>-(void)viewWillDisappear:(BOOL)animated { [[NSURLCache sharedURLCache] removeAllCachedResponses]; [webViews stringByEvaluatingJavaScriptFromString:@"document.open();document.close();"]; } </code></pre> <p>with </p> <pre><code>- (void)viewDidUnload { webViews = nil; } - (void)dealloc { [webViews release]; } </code></pre> <p>But, the reserved memory that taken from the UIWebView is still in memory,so my first question is How to force the app to free up the memory that got taken from the <code>UIWebView</code>?</p> <p>The same problem goes with <code>UIImageView</code>, i'm using a large image (about 3072*2024) that will take (3072 * 2024 * 3 = 18 MB) from the memory, i'm loading about 8 image like that at once, so the reserved memory is huge, and when i'm trying to release them, the same thing happen, the reserved memory that taken from each image is still in the memory (I'm always get the warning that said <code>Low Memory warning</code>). I've managed to load about 2 image of that size to reduce the reserved memory but the memory doesn't free up the memory until the low memory warning is appear, So, How can i reduce and deal with a huge number image and to free up the reserved memory at instance !?</p> <p>Note:</p> <p>I've used a hacked version for <code>[UIImage imageNamed:];</code> method as the following: </p> <pre><code>@implementation UIImage(imageNamed_Hack) + (UIImage *)imageNamed:(NSString *)name { return [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] bundlePath], name ] ]; } @end </code></pre> <p>Any help will be appreciated.</p> <p>Thx in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload