码迷,mamicode.com
首页 > Web开发 > 详细

webView加载本地数据

时间:2015-09-21 17:53:07      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:


[super viewDidLoad]; webview=[[UIWebView alloc] initWithFrame:self.view.bounds]; [self.view addSubview: webview]; [webview release]; // Do any additional setup after loading the view, typically from a nib.
//沙盒中读取文件
NSString *doc=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; doc=[doc stringByAppendingPathComponent:@"liuyan.html"]; NSLog(@"%@",doc); NSURL *url=[NSURL fileURLWithPath:doc]; NSLog(@"%@",url); NSURLRequest *request=[NSURLRequest requestWithURL:url]; [webview loadRequest:request]; }

webView加载本地数据

标签:

原文地址:http://www.cnblogs.com/zero-zql/p/4826588.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!