nsurl - how to convert %20 to space in Iphone SDK -


i working on app, in interacting web-service of time. getting problem when added space on somewhere convert space %20 when converting url request. googled couldn't find healthy solution according requirement because changing when url request. here doing.

    url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding];   request = [nsurlrequest requestwithurl:[nsurl urlwithstring:url]]; nslog(@"request : %@", request); [[nsurlconnection alloc] initwithrequest:request delegate:self]; 

and on nslog show me %20 ever space given. if know kindly suggest me better way solve issue. great me. in advance.

you converting spaces %20 instruction:

url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]

but necessary in order correct nsurlrequest, characters need conversion.

you can reconvert them "normal" characters using other nsstring method:

– stringbyreplacingpercentescapesusingencoding


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -