2

I have a local html file in my xcode project. but i can't load that local html file with UIWebView.

0

2 Answers 2

9

The code to achieve your request is:

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 
self.view.frame.size.height,self.view.frame.size.width)];

NSString *indexPath = [NSBundle pathForResource:@"index" ofType:@"html" inDirectory:nil];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:indexPath]]];
[self.view addSubview:webView];
Sign up to request clarification or add additional context in comments.

Comments

1

try this may it be useful to you happy coding :) 1 2 3

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.