iOS---stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - U
Posted 张文权的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS---stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - U相关的知识,希望对你有一定的参考价值。
旧方法
NSString *encoded = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
ios9 之后的 新方法
// NSString *encoded = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
// [NSCharacterSet URLQueryAllowedCharacterSet];
以上是关于iOS---stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - U的主要内容,如果未能解决你的问题,请参考以下文章