多个UIWebView实例或它是什么?

时间:2023-01-18 18:27:44

I have an app with a UIWebView in a UIView.

我在UIView中有一个带有UIWebView的应用程序。

URL to image

图像的URL

At this picture I see all my websites I visited. If I open Safari -> Developer -> Name of testing iPhone -> listed content of the picture. Are these visited sites different UIWebView instances?

在这张照片中,我看到了我访问过的所有网站。如果我打开Safari - >开发人员 - >测试iPhone的名称 - >列出的图片内容。这些访问过的网站是否有不同的UIWebView实例?

Is my suspicious correct or what is there shown?

我的怀疑是正确的还是显示的是什么?

-(void)createWebView {
    //[[self webView] removeFromSuperview];
    //[[self view] willRemoveSubview:[self webView]];
    [self setWebView:[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]];
    dispatch_async(dispatch_get_main_queue(), ^{
        [[self view] addSubview:[self webView]];
    });
    [[self webView] setScalesPageToFit:YES];
    [[self webView] setDelegate:self];

}

webView is a variable in my header file of type UIWebView and at every new entered URL the webview should be overwritten every time.

webView是我的UIWebView类型的头文件中的变量,每次输入的新URL都应该每次都覆盖webview。

1 个解决方案

#1


0  

Every Instance of UIWebView holds its own history. General Safari history is restricted to be accessed. And even if you managed to get them, i doubt your app will be accepted by Apple review team.

UIWebView的每个实例都拥有自己的历史记录。一般Safari历史记录仅限访问。即使你设法得到它们,我怀疑你的应用程序将被Apple审核小组接受。

So the solution i think is to create NSMutableArray and loop on your UIWebViews and add their history into a single place -your created array-. By so you will have all your local history in that array and do whatever you want with it.

因此,我认为解决方案是在UIWebViews上创建NSMutableArray并循环,并将它们的历史记录添加到一个地方 - 您创建的数组 - 。通过这样,您将拥有该阵列中的所有本地历史记录,并随心所欲地执行任何操作。

#1


0  

Every Instance of UIWebView holds its own history. General Safari history is restricted to be accessed. And even if you managed to get them, i doubt your app will be accepted by Apple review team.

UIWebView的每个实例都拥有自己的历史记录。一般Safari历史记录仅限访问。即使你设法得到它们,我怀疑你的应用程序将被Apple审核小组接受。

So the solution i think is to create NSMutableArray and loop on your UIWebViews and add their history into a single place -your created array-. By so you will have all your local history in that array and do whatever you want with it.

因此,我认为解决方案是在UIWebViews上创建NSMutableArray并循环,并将它们的历史记录添加到一个地方 - 您创建的数组 - 。通过这样,您将拥有该阵列中的所有本地历史记录,并随心所欲地执行任何操作。