i am developing an iOS application with uses UIWebView and Javascript. i have a javascript function like this :
function(){
....
escape(text);
.....
return text;
}
and in my UIWebView :
NSString *myString = [webView stringByEvaluatingJavascript@"function()"];
this function return to me a string encoded with the javascript function espace, how i can decode this string with objective C ? thanks for your answers
To encode a NSString with percent escapes use stringByAddingPercentEscapesUsingEncoding e.g..
To decode an already escaped NSString use stringByReplacingPercentEscapesUsingEncoding e.g..
See Documentation for NSString