Skip to content

Instantly share code, notes, and snippets.

@bonty
Last active December 20, 2015 17:48
Show Gist options
  • Save bonty/6170746 to your computer and use it in GitHub Desktop.
Save bonty/6170746 to your computer and use it in GitHub Desktop.
ローカルのhtmlファイルをUIWebViewでロードする
// 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