1

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)

manishsharma93
  • 1,039
  • 1
  • 11
  • 26
RR_Pradhan
  • 78
  • 12

1 Answers1

0

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.

Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117
  • Hi @Jeffery Thank you for your response. Below is the code - (NSString *)getHTMLString { return [self.template renderObject:self error:NULL]; } - (NSString *)getBaseURLPath { return [@"file://" stringByAppendingString:[self.lessonMainXmlPath stringByDeletingLastPathComponent]]; } html string is getting build from a template. – RR_Pradhan Apr 09 '19 at 11:07
  • @RR_Pradhan please update your question with the new information. – Jeffery Thomas Apr 09 '19 at 13:37
  • The directory is correct.There are two icplayer folder. I tried to load the file from app resources and now I am not getting 1100 error but UIWebView is showing blank page.It is even going to webViewDidFinishLoad method – RR_Pradhan Apr 09 '19 at 15:04