I have a URL string (NSString) with spaces and & characters. How do I url encode the entire string (including the & ampersand
NSString
&
//This is without test
NSMutableCharacterSet* set = [[NSCharacterSet alphanumericCharacterSet] mutableCopy]; [set addCharactersInString:@"-_.~"]; NSString *encode = [test stringByAddingPercentEncodingWithAllowedCharacters:set];