0

My app, on very rare occasions, freezes when I select text in a UIWebView. Here's how it happens:

  1. Tap and hold to select text
  2. Text gets selected
  3. Whole app freezes, unresponsive to touch, but I can still see operatings running
  4. 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
  5. If the text is still selected, it freezes again if I scroll. Happens again and again
  6. 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
  7. 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.
  8. 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.

michaeltwofish
  • 4,096
  • 3
  • 28
  • 32
honcheng
  • 2,014
  • 13
  • 14

1 Answers1

0

I suspect you either have set up your view hierarchy improperly, or have modified it on a thread not the main thread. So tell us exactly where the UIWebView resides (super views), and take a good look at code that modifies sub view arrays.

For instance, you don't add the web view to a UINavigationController's sub views directly, but to its view controllers array etc.

All else fails create a demo project that also displays the problem and upload it to DropBox where we can run it ourselves.

David H
  • 40,852
  • 12
  • 92
  • 138