Can someone tell me why am getting this error and how to resolve this error . Am trying to load a html file which is saved locally under a folder inside the documents directory . The html file has jss and css files linked to it . Please help me resolve this issue .
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *path = [paths objectAtIndex:0];
NSLog(@"Saving");
NSUserDefaults *prefs = [[NSUserDefaults alloc] init];
bookid = [NSString stringWithFormat:@"%@",[prefs objectForKey:@"bookid"]];
NSString *path1 = [NSString stringWithFormat:@"/%@",bookid];
NSString *dataPath = [path stringByAppendingPathComponent:path1];
dataPath = [dataPath stringByStandardizingPath];
NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:dataPath error:NULL];
for (int count = 0; count < (int)[directoryContent count]; count++)
{
NSLog(@"File %d: %@", (count + 1), [directoryContent objectAtIndex:count]);
}
filePath = [dataPath stringByAppendingPathComponent:@"index.html"];
NSString* htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[_BookReaderWeb loadHTMLString:htmlString
baseURL:[NSURL fileURLWithPath:dataPath]];
This is the error which am getting :
Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x7ffb2a96acf0 {NSUnderlyingError=0x7ffb286b7d20 "The requested URL was not found on this server.", NSErrorFailingURLStringKey=file:///Users/ChanqBro/Library/Developer/CoreSimulator/Devices/A54D2148-91C3-49F4-B94C-CE46DEAEEC58/data/Containers/Data/Application/D08784A9-D5DD-41DE-95C5-DB97BE91BBBC/Library/Caches/3021/blank.html, NSErrorFailingURLKey=file:///Users/ChanqBro/Library/Developer/CoreSimulator/Devices/A54D2148-91C3-49F4-B94C-CE46DEAEEC58/data/Containers/Data/Application/D08784A9-D5DD-41DE-95C5-DB97BE91BBBC/Library/Caches/3021/blank.html, NSLocalizedDescription=The requested URL was not found on this server.}
<html>
<head>
<meta charset="UTF-8">
<title> HELLO </title>
<!-- MONOCLE CORE -->
<script type="text/javascript" src="monocore.js"></script>
<script type="text/javascript" src="monoctrl.js"></script>
<script type="text/javascript" src="book_data.js"></script>
<script type="text/javascript" src="test.js"></script>
<link rel="stylesheet" type="text/css" href="monocore.css" />
<link rel="stylesheet" type="text/css" href="monoctrl.css" />
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<div id="reader"></div>
</body>
</html>
blank.htmlin that directory? - Jeffery Thomasindex.htmlrequestingblank.html? Somewhere in the HTML, CSS or JavaScript, the URL is being asked for. - Jeffery Thomas