Created
November 11, 2012 15:41
-
-
Save mikeabdullah/4055259 to your computer and use it in GitHub Desktop.
Using WebKit to encode unescaped URL strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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