Note that there are some explanatory texts on larger screens.

plurals
  1. POpage based app with uiwebviews memory leak
    primarykey
    data
    text
    <p>I'm doing some testing with the simple Xcode page base application using Arc.</p> <p>I'm loading a uiwebview with in the dataviewcontroller and I've been testing the activity with Instruments, the memory usage keeps going up and up as i scroll the pages and it looks like the previous pages are never release from memory. </p> <p>here are the changes I made to the default template. I've modified the model to run for 240 pages rather than the 12 defaults.</p> <p>In the dataViewController, I'm adding a uiwebview programatically and loading request to google and add the webview to the controller view.</p> <p>Memory usage starts at about 20Mb and eventually gets to over 70Mb and then it crashes.</p> <p>Anybody know where I'm going wrong? How can I release the views to free up memory?</p> <p>amended code below:</p> <p>DataViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface RXBDataViewController : UIViewController&lt;UIWebViewDelegate&gt; { UIWebView *pageContent; } @property (strong, nonatomic) IBOutlet UILabel *dataLabel; @property (strong, nonatomic) id dataObject; @end </code></pre> <p>DataviewController.m</p> <pre><code>#import "RXBDataViewController.h" @interface RXBDataViewController () @end @implementation RXBDataViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. pageContent = [[UIWebView alloc] initWithFrame:CGRectMake(8, 30, 260, 350)]; pageContent.userInteractionEnabled = NO; [pageContent setDelegate:self]; [pageContent loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/"]]]; [self.view addSubview:pageContent]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.dataLabel.text = [self.dataObject description]; } @end </code></pre> <p>Thanks in advance for suggestions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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