stringByAddingPercentEscapesUsingEncoding was deprecated in 9.0 .How to do this?

后端 未结 5 741
野性不改
野性不改 2020-12-29 03:56

I\'m a junior developer, and I got a code for this:

(NSString *)encodedStringFromObject:(id)object {
    return [[object description] stringByAddingPercentEs         


        
5条回答
  •  长情又很酷
    2020-12-29 04:39

    URL = [[NSString stringWithFormat:@"%@XYZ",API_PATH]stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    

提交回复
热议问题