我使用這個代碼片段編碼字符與POST請求友好:逃生行情在Objective-C
NSString *unescaped = [textField text];
NSString *escapedString = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(__bridge_retained CFStringRef)unescaped,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
偉大的工程,但不加逃逸引號:"
如何在IOS中轉義引號?
爲什麼不使用NSRegularExpression的」escapedPatternForString:「類方法? – Manoj 2014-12-09 19:00:11