I’m loading a Test.pages file in my UIWebView which is called myUniqueWebView in my app but I get this error
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
I’m using this code
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"Test" ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}
And this code in the viewDidLoad
[self loadDocument:@"Test.pages" inView:self.myUniqueWebView];
Any ideas why it’s not working? I’m testing it on my device. Thanks in advance!
EDIT:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"pages"];
isn’t working and if I zip the file it just loads an empty UIWebView
I have tried everything and only succeeded in viewing PDF files. That’s very disappointing, but that’s how it is.