NSString *htmlPath = @"addComment.html"; NSString *encodedPath = [htmlPath stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString *urlStr = nil; if (self.itemId == 0) { urlStr = [NSString stringWithFormat:@"file://%@", encodedPath]; } else { urlStr = [NSString stringWithFormat:@"file://%@?userId=%@", encodedPath, self.itemId]; } NSURL *url = [NSURL URLWithString:urlStr]; NSURLRequest *request= [NSURLRequest requestWithURL:url]; [webView loadRequest:request];
UIWebView加载本地文件
猜你喜欢
转载自shfzhzhr.iteye.com/blog/1808004
今日推荐
周排行