page.zip 文件将无法使用 UIWebview 和 NSURL 显示视图

发布于 2024-10-07 23:00:37 字数 700 浏览 0 评论 0原文

我有一个显示搜索提示的应用程序。如果我将 .html 文件存储在主包中并使用 Apple 示例代码显示它,这将起作用:

-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
    NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
}

//load document --
    [self loadDocument:@"searchTipsLegislators.html" inView:searchTips];

但是,如果我将文档更改为使用压缩页面文件创建的文档,则应用程序将返回错误:

2010-12-15 08:53:04.537 cv112[42067:7003] 无法加载 iWorkImport

2010-12-15 08:53:04.538 cv112[42067:7003] 无法生成预览

有人让它工作吗?

I have an application that displays search tips. This will work if I store an .html file in the main bundle and display it using the Apple example code:

-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
    NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
}

//load document --
    [self loadDocument:@"searchTipsLegislators.html" inView:searchTips];

If however I change the document to one created using a compressed Pages file the app return the error:

2010-12-15 08:53:04.537 cv112[42067:7003] Cannot load iWorkImport

2010-12-15 08:53:04.538 cv112[42067:7003] Failed to generate preview

Has anyone gotten this to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两人的回忆 2024-10-14 23:00:37

要尝试两件事:

  1. 不要压缩页面文档。从 iOS 3 开始不再需要这样做。

  2. 不要指望这能在模拟器上工作。它可以在您的设备上运行吗?

Two things to try:

  1. Don't compress the pages document. This is no longer necessary as of iOS 3.

  2. Don't expect this to work on Simulator. Does it work on your device?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文