I have a URL string (NSString) with spaces and & characters. How do I url encode the entire string (including the & ampersand
NSString
&
ios 7 update
NSString *encode = [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; NSString *decode = [encode stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];