ios - Properly Decoding string url for casting in NSURL -


i making player going support google dfp adserver. ad-server has vast link xml type , contains media-file, track links, clicklink etc...

the clicklinks includes redirecting url original url not decode.

the link looks like: https://pubads.g.doubleclick.net/aclk?sa=l&ai=b2jsprfckvq_sasifbr-gqpae9-cgpqcaaaaqascpsd4loaby37owp4gcyjn-noa4ibobczyynhgzntjfeg1syaef2gefahr0cdqpargojxr685u-waic4aia6giulzezmtmwmjqwny9vem1hbl9ea3n4avtrhpadhaeya4qhqamb0asqtuaeazagaaagi9ghaq&num=0&cid=5ggrgwo88ghdud7jbb6utlxz&sig=aod64_0xhsqn4jsnvoz-eko9kcvtet61iq&client=ca-pub-3069068742246799&adurl=http://dkykartal.com/%3futm_source%3duzmantv%26utm_medium%3dvideo_preroll%26utm_content%3ddky_kartal%26utm_campaign%3ddky_kartal_ibillboard

i tried decode using stringbyaddingpercentescapesusingencoding , encode again nsurl seems broken.

original vasturl is:

https://pubads.g.doubleclick.net/gampad/ads?sz=624x352&iu=/131302407/uzman_dky&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=1443516172

how can cast nsurl?

read question again, carefully. want decode url , call method that's called

stringbyaddingpercentescapesusingencoding         ^^^^^^ 

try using stringbyremovingpercentencoding. should decode url.

to other question, how "cast" nsurl: casting means forcing debugger treat variable specific type. meaning cannot cast object , turn instance of type.

you have create instance of nsurl using string:

nsurl *url = [nsurl urlwithstring:[urlstring stringbyremovingpercentencoding]];


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -