【问题标题】:Document and data when using a web reader使用网络阅读器时的文档和数据
【发布时间】:2012-02-03 19:20:23
【问题描述】:

我使用 WebViewController 访问应用程序中的某些 URL。 现在我发现每次使用 WebViewController 时应用程序的大小都会慢慢增加。 这是在 iPhone 使用情况下检查应用程序大小时,该特定应用程序的文档和数据在每次使用时都会增加。该应用程序在安装时可能为 2 Mb,但经过大量使用后,它可能很容易增加到 25 Mb。关闭应用时如何释放指纹??

当调用 WebViewController 时,它的外观是这样的。

- (void) showURL:(NSURL *)address withTitle:(NSString *)title
{
    MyWebViewController *vc = [[MyWebViewController alloc] initWithNibName:@"MyWebViewController" bundle:nil];//ny
    vc.title = title;
    vc.location = address;
    [self.navigationController pushViewController:vc animated:YES];
    [vc release];
}

h。 WebWiewController 中的文件在其内容中有这个。

NSURL *location;
IBOutlet UIWebView *theWebView;

m.file 有这个

- (void)viewDidLoad
{
    [super viewDidLoad];

    [theWebView loadRequest:[NSURLRequest requestWithURL:location]];
}

【问题讨论】:

    标签: iphone xcode url webview document


    【解决方案1】:

    您的 Webview 似乎正在缓存该页面。 也许您应该手动创建您的 http 请求来自定义缓存策略。

    例如:

     NSURL *url = [NSURL URLWithString:URL];
     NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 
     [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
     [webView loadRequest:request];
    

    我没有尝试代码,只是提供一个想法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多