在iOS 9.0之后,以前常用的NSString
编码的方法stringByAddingPercentEscapesUsingEncoding:
被弃用了,项目中可能会出现一堆如下⚠️:
‘stringByAddingPercentEscapesUsingEncoding:’ is deprecated: first deprecated in iOS 9.0 - Use-stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.
作为一个有强迫症的优秀程序猿,表示不能忍!