I am having some set of html files and want to switch between them in a webView.
When i try to load any html then it gives me some thing like this
Load error,The opertaion couldn't be completed.(NSURLErrorDomain error -999.)
How would i fix this issue.
for loading htm i am using the lines of code
self.playerPath = [[BundleUtils bundleDirectoryFor:nil] stringByAppendingPathComponent:@"Browser Player files/HTMLplayer/RENE001NL_p001_G02_20_meeleesboek_XCode_pagetr_test_Newgen/"];
NSString* indexFilePath = [self.playerPath stringByAppendingPathComponent:@"index001.html"];
NSURL* indexUrl = [NSURL fileURLWithPath:indexFilePath];
[self.browserView loadRequest:[NSURLRequest requestWithURL:indexUrl]];
+ (NSString *) bundleDirectoryFor:(NSString *) bundleName
{
NSString* bundlePath = nil;
if (bundleName) {
NSString* basePath = [[[NSBundle mainBundle] resourcePath]
stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", bundleName]];
NSBundle* bundle = [NSBundle bundleWithPath:basePath];
bundlePath = [bundle resourcePath];
} else {
bundlePath = [[NSBundle mainBundle] resourcePath];
}
return bundlePath;
}