UIWebView throwing exception for [WebActionDisablingCALayerDelegate setBeingRemoved:]

Arie Litovsky picture Arie Litovsky · Sep 17, 2014 · Viewed 17.6k times · Source

When running against iOS 8, I began to see the following exception coming from the deep bowels of UIWebView:

[WebActionDisablingCALayerDelegate setBeingRemoved:]: unrecognized selector sent to instance 0x167ee900

* WebKit discarded an uncaught exception in the webView:willRemoveScrollingLayer:withContentsLayer:forNode: delegate: -[WebActionDisablingCALayerDelegate setBeingRemoved:

This is happening when I change some constraints on my UIWebView and then call:

 self.webViewWidthConstraints.constant = newWidth;
 [self.webView setNeedsLayout];
 [self.webView layoutIfNeeded];

(This is so that the webview's content is re-rendered to fit its width correctly).

Luckily the exception is discarded, so the app isn't crashing. Why is this happening, and is there any way to prevent it?

Answer

maidbarion picture maidbarion · Nov 7, 2014

I found that by adding "-webkit-transform: translateZ(0px);" to the scrollable content (I have a div inside my scrollable container), it fixed the issue for me. Hope this helps.