Debugging? That's cool. Just don't submit a build with this code in it to Apple -- it will get rejected for using a private API (the underscore in _enableRemoteInspector is a dead giveaway).
takes care of that already, it won’t be in an App Store build.
Another thing to note is that the inspector will use take the first webview in your application. There’s a common trick of creating an off-screen webview for checking the user agent string for whatever reason, and if you use a remote inspector you’ll get that one.
Uh, shouldn't the class be `UIWebView`, not `NSClassFromString(@"WebView")`? (Specifically, the class name would be missing the UI prefix, and the string-class conversion is redundant.)
The `_enableRemoteInspector` is a private method to the private class `WebView`. If you use `UIWebView` it will cause runtime exception 'NSInvalidArgumentException', reason: '+[UIWebView _enableRemoteInspector]: unrecognized selector sent to class 0x6df1ec'
If Automatic reference counting (ARC) feature was enabled, the compiler would raise an error for the code `[NSClassFromString(@"WebView") _enableRemoteInspector];` : "No known class method for selector '_enableRemoteInspector.'"
[+] [-] Xuzz|13 years ago|reply
This post is essentially just a compiler warning fix for the (much more interesting) one linked.
[+] [-] brainlock|13 years ago|reply
I had a rendering bug that only happened on the device, not in the simulator.
This opens the web inspector locally, and exposes a proxy on port 55555 for you to access from your working machine.
Not really useful on iOS 6 anymore :-) but still, useful on iOS 5.
[+] [-] jfhollingworth|13 years ago|reply
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] shaggyfrog|13 years ago|reply
[+] [-] sjmulder|13 years ago|reply
Another thing to note is that the inspector will use take the first webview in your application. There’s a common trick of creating an off-screen webview for checking the user agent string for whatever reason, and if you use a remote inspector you’ll get that one.
[+] [-] dryman|13 years ago|reply
[+] [-] falling|13 years ago|reply
[+] [-] SeoxyS|13 years ago|reply
[+] [-] dryman|13 years ago|reply
If Automatic reference counting (ARC) feature was enabled, the compiler would raise an error for the code `[NSClassFromString(@"WebView") _enableRemoteInspector];` : "No known class method for selector '_enableRemoteInspector.'"