ios - UIWebView error -999 -
this question has answer here:
i have uiwebview on view , when cliked in link, launch view content.
nslog(@"---> %@",url); nsurl *websiteurll = [nsurl urlwithstring:url]; nsurlrequest *urlrequestt = [nsurlrequest requestwithurl:websiteurll]; nslog(@"---> %@",urlrequestt); in output have
- url : http:// url .php
- urlrequestt : : { url: http:// url .php }
(void)webview:(uiwebview *)webview didfailloadwitherror:(nserror *)error { nslog(@"error %li", (long)error.code); if (error.code == nsurlerrorcancelled) return; // error -999 nslog(@"canceled request: %@", [webview.request.url absolutestring]); }
in output error have number -999
i don't know why page doesn't load type of file... uiwebview works fine simple html file advance.
i finished find answer, better place load content in uiwebview in viewdidappear not in viewdidload
i think having escape sequences in url try loading webview this
url = [url stringbyaddingpercentescapesusingencoding: nsutf8stringencoding]; nsurl *websiteurll = [nsurl urlwithstring:url]; nsurlrequest *urlrequestt = [nsurlrequest requestwithurl:websiteurll]; nslog(@"---> %@",urlrequestt);
Comments
Post a Comment