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

A little optimized suggestions #65

Open
zhangbo opened this issue Jul 12, 2017 · 0 comments
Open

A little optimized suggestions #65

zhangbo opened this issue Jul 12, 2017 · 0 comments

Comments

@zhangbo
Copy link

zhangbo commented Jul 12, 2017

In CSApiManager.m

In these methods:
-(void) apiGETCallWithURL:(NSString*)url
indicatorVC:(CSBaseViewController*)vc
toShowIndicator:(BOOL)toShow
toHideIndicator:(BOOL)toHide
completition:(apiCallFinish)finish

-(void) apiPOSTCallWithUrl:(NSString*)url
parameters:(NSDictionary*)params
indicatorVC:(CSBaseViewController*)vc
toShowIndicator:(BOOL)toShow
toHideIndicator:(BOOL)toHide
completition:(apiCallFinish)finish {

encode the url string:
url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

In order to avoid app crash by containing special characters in url such as Chinese.

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

1 participant