How to encode an URL for HTML

It’s very easy to URL Encode an NSString in Objective-C (i.e. make a string safe to send using a GET request). If you do not do this, the call will simply fail.  Simply do this: NSString* escapedUrlString = [unescapedString stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding]; Then just use the escapedUrlString in your NSURL object and you’re on your way.