iOS init UIWebView清除导航历史记录 [英] iOS init UIWebView to clear navigation history

查看:310
本文介绍了iOS init UIWebView清除导航历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在IB上根据需要设置uiWebviewSocial并正常加载请求。但是,稍后我还需要初始化这个uiwebview以便清除goBack历史记录。我正在使用另一个uiwebview对象,webViewBridge

I am setting uiWebviewSocial as desired on IB and is loading requests as normal. However, later I need also to init this uiwebview in order to clear goBack history. I am using another uiwebview object for this purpose, webViewBridge

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.webviewBridge = [[UIWebView alloc] init];
    self.webviewBridge = self.webViewSocial;

当我需要初始化UIWebViewSocial时,我使用以下

when I need to init UIWebViewSocial, I use following

    self.webViewSocial = nil;
    self.webViewSocial = [[UIWebView alloc] init];
    self.webViewSocial = self.webviewBridge;

但是,如果我然后进行goBack操作,uiwebview会在其历史记录为空时加载旧请求。我错过了什么?谢谢

however, if I then make goBack action, uiwebview loads an old request when should have its history empty. What I am missing? thank you

推荐答案

好吧,我一直在 UIWebView 中这些天堆栈溢出,至少对我来说是一团糟。

Well, I've been going aroundUIWebView in Stack Overflow these days and is a mess, for me at least.

看来 UIWebView 缓存是独立工作的,我的意思是我们不能改变访问一些专门管理的信息按系统...

It seemsUIWebView cache works at its own, I mean we cannot change neither access some info that is exclusively managed by system...

关于你的问题,虽然你的 UIWebView 被发送到nil,它仍然会来自缓存的信息...所以,你应该清除缓存firstable
你可以检查它这里那里

About your problem, it seems although yourUIWebView is sent to nil, it keeps getting info from cache... so, you should clear cache firstable You can check it here and there

这篇关于iOS init UIWebView清除导航历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆