Reputation: 3998
This works in OS X:
WebPreferences *prefs = [webView preferences];
[prefs setDeveloperExtrasEnabled:YES];
WebInspector *inspector = [[WebInspector alloc] initWithWebView:webView];
But crashes in macOS:
-[WebInspector initWithWebView:]: unrecognized selector sent to instance 0xb1ab1ab1a
Is this Private API thrown out?
The code is taken from here.
Upvotes: 1
Views: 295
Reputation: 3998
They've renamed it: http://trac.webkit.org/changeset/189654
TLDR:
WebInspector *inspector = [WebInspector alloc];
if ([inspector respondsToSelector:@selector(initWithWebView:)])
[inspector initWithWebView:webView];
else
[inspector initWithInspectedWebView:webView];
In case of future changes, just look at the WebKit source code.
Upvotes: 2