Mike Austin's Blog

Wednesday, December 09, 2009

Loading local web resources on iPhone

I wanted to learn how to load web resources locally, so I finally found how:
NSString *path = [[NSBundle mainBundle] pathForResource: "test.html" ofType: @""];
[self.webView loadRequest: [NSURLRequest requestWithURL: [NSURL fileURLWithPath: path]]];
Objective-C is pretty convoluted sometimes!
Also, you have to make your javascript resources non-executable

0 Comments:

Post a Comment

<< Home