Created
February 3, 2012 11:00
-
-
Save quietcricket/1729667 to your computer and use it in GitHub Desktop.
Solve & problem in URL
This file contains hidden or 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
NSString* link=[NSString stringWithFormat:@"https://twitter.com/intent/tweet?url=http://google.com&text=",@"Some text that may have & damn you &&&"]; | |
link=[link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
link=[link stringByReplacingOccurrencesOfString:@"&" withString:@"%26" options:NSLiteralSearch range:NSMakeRange([link rangeOfString:@"&"].location+1, link.length-1)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment