2010-01-31 57 views
3

我想要使用下面显示的方法加载应用程序文档目录本地存储的HTML文件。这不是工作。我究竟做错了什么?如何使用UIWebview加载LOCAL .html文件?

NSLog(@"Loading Saved Copy!"); 
urlAddress = [[self documentsDirectory] stringByAppendingPathComponent:@"/Profile/profile.html"]; 


      //Create a URL object. 
      NSURL *url = [NSURL URLWithString:urlAddress]; 
      //URL Requst Object 
      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; 
      //Load the request in the UIWebView. 
      [webView loadRequest:requestObj]; 

回答

4

改为使用+[NSURL fileURLWithPath:isDirectory:]