有些软件中可能会用到html页面,比如用在做帮助页面或者其它相关信息时。 这种情况下只需要将html页面文件以及索引用到的资源(图片、声音等) 都加入到bundle中,或者单独创建一个bundle, 在需要的时候调用UIWebView的相关方法即可
NSBundle* bundle = [NSBundle mainBundle];
NSString* resPath = [bunder resourcePath];
NSString* filePath = [resPath stringByAppendPathComponent:@"test.html"];
[WebView loadHTMLString:[NSString stringWithContentsOfFile:filePath] baseURL:[NSURL fileURLWithPath:[bundle bundlePath]]];