My app, on very rare occasions, freezes when I select text in a UIWebView. Here's how it happens:
- Tap and hold to select text
- Text gets selected
- Whole app freezes, unresponsive to touch, but I can still see operatings running
- May freeze for around 10s. After that the UIMenuController appears. If I try to scroll while it is freezing, the scrolling happens after the app is responsive again
- If the text is still selected, it freezes again if I scroll. Happens again and again
- If I managed to scroll the selected text out of the view, scrolling the rest of the webview is fine, until I scroll the selected text back
- If I get out of the UIViewController containing the UIWebView, I can confirm that they are both deallocated. Go back into a new UIViewController with UIWebView and it happens again.
- This continues to happen with new instances of UIWebView, and even when I close and resume the app. Only stops if I force a restart of the app.
Does anyone have any clue how I can debug this? I've never seen this in simulator. Only happens very rarely on device.