How to fix “nsurlconnection finished with error - code 1100 ” error for UIWebView in IOS?

人走茶凉 提交于 2019-12-11 08:41:16

问题


I am working on an existing project where UIWebview is used to load html string to load js files for loading contents downloaded from our server.Currently UIWebview is not able to load the contents in IOS which is perfectly loading in Android.

I have tried to switch to WKWebView but still no luck.

self.webContentView.delegate = self;
NSString* html = [player getHTMLString];
NSString* baseURL = [player getBaseURLPath];
[self.pageLoadingActivity startAnimating];
[self.webContentView loadHTMLString:html baseURL: [NSURL URLWithString: baseURL]];

EDIT------

After debugging sometime I found I was getting two 1100 error. It seemed like two file were missing or app was not able to read them. Now whenever I am hitting shouldStartLoadWithRequest with request URL:

file:///Users/ealpha4tech/Library/Developer/CoreSimulator/Devices/2CA71983-9996-44D6-944F-34E3EAFAE96D/data/Containers/Data/Application/6A19ABBA-CB68-4EE4-AC02-6AD3CB8A5A68/Documents/icplayer/icplayer/D2D6AFFF93CB2CFCB1640484F5429D89.cache.html

I am getting 1100 error.(the above file is present though)


回答1:


So as a guess, I would say [player getHTMLString] is the problem.

NSURLErrorFileDoesNotExist: The specified file doesn’t exist.

This is a local file error.

I'm guessing that -getHTMLString is trying to load a file out of the app, but that file is not being included in the app.

I could help more if you provide 2 things.

  1. Provide the source for -getHTMLString
  2. Use NSLog() to print value of [player getBaseURLPath].

UPDATE

In looking at your output, I noticed …ments/icplayer/icplayer/D2D6A…. I think the proper path should only have one icplayer not two. Look to see if it's getting repeated somehow.



来源:https://stackoverflow.com/questions/55590079/how-to-fix-nsurlconnection-finished-with-error-code-1100-error-for-uiwebvie

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