I have tried the method stringByReplacingPercentEscapesUsingEncoding: , but I have still the percentages.
Are you looking at the string that message returned, or the string you sent that message to? If you're doing this:
NSString *myString = @"it-strategy%20RZ%20U%20texas";
[myString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
That's wrong.
A method named like stringByDoingSomething
or arrayByAddingOrRemovingThings:
will return a new object with the requested modification applied—the original object, myString
in the above example, remains unchanged.
The percent escape sequences have been replaced in the string that stringByReplacingPercentEscapesUsingEncoding:
returned. That's the string you need to look at:
NSString *unescapedString = [myString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];