Skip to content

Instantly share code, notes, and snippets.

@norio-nomura
Created February 13, 2009 07:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norio-nomura/63775 to your computer and use it in GitHub Desktop.
Save norio-nomura/63775 to your computer and use it in GitHub Desktop.
UIWebView target="_blank" hack
static NSObject *webViewcreateWebViewWithRequestIMP(id self, SEL _cmd, NSObject* sender, NSObject* request) {
return [sender retain];
}
Class UIWebViewWebViewDelegate = objc_getClass("UIWebViewWebViewDelegate");
class_addMethod(UIWebViewWebViewDelegate, @selector(webView:createWebViewWithRequest:), (IMP)webViewcreateWebViewWithRequestIMP, "@@:@@");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment