Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFURLCreateStringByAddingPercentEscapes is deprecated – warning suppressed #141

Open
appsunited opened this issue Nov 13, 2015 · 2 comments

Comments

@appsunited
Copy link

Due the fact that CFURLCreateStringByAddingPercentEscapes is deprecated since iOS 9.0 the method [NSString stringByAddingPercentEncodingWithAllowedCharacters:] should be used instead.

Also we are not sure whether it's a good idea to suppress the warning via:

pragma clang diagnostic ignored "-Wdeprecated-declarations"

@appsunited appsunited changed the title CFURLCreateStringByAddingPercentEscapes is deprecated CFURLCreateStringByAddingPercentEscapes is deprecated – warning suppressed Nov 13, 2015
@uerceg
Copy link
Contributor

uerceg commented Dec 1, 2015

@appsunited Thanks for your suggestion and yes, we will remove suppressions in next updates, probably next one. Will keep you updated.

@uerceg uerceg added the support label Jun 6, 2018
@uerceg uerceg removed the support label Mar 20, 2019
arietis added a commit to arietis/ios_sdk that referenced this issue Feb 9, 2020
arietis added a commit to arietis/ios_sdk that referenced this issue Feb 9, 2020
@uerceg uerceg assigned uerceg and unassigned uerceg Dec 2, 2021
@fadyyecob
Copy link

fadyyecob commented Jan 4, 2022

I created a PR (#583) to use [self stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]] and remove the commented code. Imo using this function with URLQueryAllowedCharacterSet is the proper way to send a query string over an URLRequest

Please take a look and review @uerceg

Edit: updated my PR. It still uses URLQueryAllowedCharacterSet but subtracts the original characters "!*'\"();:@&=+$,/?%#[]% ", since those should also be encoded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants