iOS : How to do proper URL encoding?

后端 未结 10 1907
一整个雨季
一整个雨季 2020-12-13 19:20

I\'m unable to open a URL into UIWebView so I\'ve seached & found that I need to encode URL, so I tried to encode it but, I\'ve facing problem in URL encodi

10条回答
  •  再見小時候
    2020-12-13 19:27

    can you please Try this out.

        //yourURL contains your Encoded URL
        yourURL = [yourURL stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
        yourURL = [yourURL stringByReplacingOccurrencesOfString:@"\n" withString:@""];
        NSLog(@"Keyword:%@ is this",yourURL);
    

    I am not sure,but I have solved using this in my case. Hope this will solve yours.

提交回复
热议问题