3

我正在尝试使用下面显示的方法加载本地存储在应用程序文档目录中的 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

1 回答 1

4

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

于 2010-01-31T07:36:50.373 回答