IOS 5 - Collecting private debugging APIs - specifically _enableRemoteInspector

I was looking for a way to debug JavaScript in a UIWebView and came across some articles about _enableRemoteInspector specifically

http://atnan.com/blog/2011/11/17/enabling-remote-debugging-via-private-apis-in-mobile-safari/

I could not get the sample code to compile. I keep getting the error "Unknown class method for selector". Not just a warning.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    //Works
    [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)];

    //Won't compile
    //[NSClassFromString(@"WebView") _enableRemoteInspector];
}

So, I tried to execute a Selector, and it works, and the debugger works as described.

But how do you compile it without resorting to executing the Selector function?

I am running Xcode 4.2.1 and my project is using iOS5 SDK.

+5
source share
1 answer

(ARC) iOS 5. , , , ARC.

ARC, [NSClassFromString(@"WebView") _enableRemoteInspector] " " ( ).

, ARC, . , performSelector, ARC.

+7

All Articles