Loading a large web page in a UIWebView

Whenever I load a large web page into a UIWebView in my application, it always crashes (low memory) after a few seconds before the page is fully loaded. A page of about 500 thousand pages is fined in safari, but I noticed that the whole page is not displayed initially. (showing checkerboard background)

How can I do this so that the UIWebView does not crash when loading a large file?

+3
source share
1 answer

Well One simple approach that works in UIWebView Optimization is pretty simple, and I found it effective in one of my applications. Creating new instances of UIWebView every time a user acts is not an acceptable solution and, most likely, the application crashes after several loads. Keep a single instance of UIWebView with which you can work with all applications, so you do not need to call ALLOC in UIWebView every time you want to load a web page. Just use the UIWebView loadRequest: method to change the URL you want the user to point to. Hope this will reduce memory consumption.

0
source

Source: https://habr.com/ru/post/1778852/


All Articles