問題描述
清理 ios 中的 uiwebview 緩存 (clean uiwebview cache in ios)
我正在使用 uiwebview 來顯示我的網頁內容。使用 RevealViewController 導航到不同的 url。我正在緩存第一次進入的所有頁面。
在嘗試轉到後視圖(顯示視圖控制器菜單屏幕)時訪問了幾個頁面後,應用程序在單擊菜單按鈕時卡住了一段時間.
(每次訪問和緩存一個頁面都會增加app的內存大小)
參考解法
方法 1:
If the presentation of the menu is slow, it is probably because you are doing some heavy processsing inside the initialiser
of the menu or the viewDidLoad
function, or the menu button pressed function.
My suggestion is to move any of that processing to the viewDidAppear method of your menu controller instead, so that the UI is not blocked by any processing you do. You could also use GCD to disaptch_async
anything that is intensive.
If you give some code examples it will be easier to see exactly what the problem is, particularly the code that executes when the menu button is pressed.
(by Rabindra Laheri、BinaryGuy)