UIWebView: Error while loading URL

我与影子孤独终老i 提交于 2019-12-01 18:19:18
Atagyz

I think the problem can be the anchor in your URL, a friend got the same problem

Thanks guy, that'it, I have split the URL like this:

NSArray *split = [url componentsSeparatedByString:@"#"];

NSURL *requestUrl = [NSURL URLWithString:[[split objectAtIndex:0] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

and now it work , thanks for your help !

KarenAnne

I have this code which also triggers error code 101

 _request = [NSURLRequest requestWithURL:[NSURL URLWithString:redirectUrl]];
            [editorWebView loadRequest:_request];

RedirectURL is an NSString which has this format http%3A%2F%2Fwww.linkedin.com%2Fnhome%2F

I tried removing percent escapes using the method of NSString and it now works.

[redirectUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!