ios中UIWebview中加载本地文件
2013-07-08 14:07 甘超波 阅读(7085) 评论(1) 编辑 收藏 举报[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]; }
目前我正在专注NLP,请立刻加微信/QQ号 546611623, 免费送你原创《NLP高级执行师》高清视频