Skip to content

Instantly share code, notes, and snippets.

@Abizern
Forked from pburleson/gist:4079642
Created November 15, 2012 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Abizern/4082492 to your computer and use it in GitHub Desktop.
Save Abizern/4082492 to your computer and use it in GitHub Desktop.
Using WebKit to encode unescaped URL strings
- (NSURL)URLFromString:(NSString *)string;
{
static NSPasteboard *pboard;
if (!pboard) pboard = [[NSPasteboard pasteboardWithUniqueName] retain];
[pboard clearContents];
[pboard writeObjects:@[string]];
NSURL *result = [WebView URLFromPasteboard:pboard];
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment