0
votes

I would like to know if I am using good memory management practise with UIWebView. My app makes extensive use of hundreds of local html files, which the user can get to at the end of a table hierarchy. The user can also swipe left and right for previous and next pages.

In viewDidLoad, I set everything up, such as background colour and gesture recognizers, and I add it to the view:

[self.view addSubview: self.myWebView];

Only in dealloc do I set the UIWebView's delegate to nil, and release it.

In viewWillAppear, I set the UIWebView's delegate to self, while in viewWillDisappear, I set the delegate to nil (as well as ask it to "stopLoading").

Each time I load a new document in, I use loadHTMLString:

[self.myWebView loadHTMLString:fullHTML baseURL:nil];

Is what I'm doing sufficient to keep the memory happy? Is this issue from two years ago still relevant?

Thank you!

1

1 Answers

0
votes

What you have written should not leak memory. I don't know if the issue you linked to still happens, but I have not had problems with it in my use of UIWebView.