Last active
December 20, 2015 17:48
-
-
Save bonty/6170746 to your computer and use it in GitHub Desktop.
ローカルのhtmlファイルをUIWebViewでロードする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in Resources Directory | |
NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"]; | |
// in Documents Directory | |
NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; | |
NSURL *url = [NSURL fileURLWithPath:path]; | |
NSURLRequest *req = [NSURLRequest requestWithURL:url]; | |
[self.webView loadRequest:req]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment