Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在后台使用UIWebview_Iphone_Xcode_Multithreading_Uiwebview_Background - Fatal编程技术网

Iphone 如何在后台使用UIWebview

Iphone 如何在后台使用UIWebview,iphone,xcode,multithreading,uiwebview,background,Iphone,Xcode,Multithreading,Uiwebview,Background,我想设置UIWebview始终在后台运行。 当iPhone输入“ApplicationIdentinterBackground”时,UIWebview不工作。 因此,我希望UIWebview始终在后台运行。 有可能吗?每个应用程序在终止前都可以在后台继续执行大约10分钟。只有某些应用程序可以在后台继续执行,如音频/gps/蓝牙等相关应用程序。你可以找到更多 下面的代码示例来自应用程序文档,可以帮助您入门- - (void)applicationDidEnterBackground:(UIAppl

我想设置
UIWebview
始终在后台运行。 当iPhone输入“
ApplicationIdentinterBackground
”时,
UIWebview
不工作。 因此,我希望
UIWebview
始终在后台运行。
有可能吗?

每个应用程序在终止前都可以在后台继续执行大约10分钟。只有某些应用程序可以在后台继续执行,如音频/gps/蓝牙等相关应用程序。你可以找到更多

下面的代码示例来自应用程序文档,可以帮助您入门-

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
        // Clean up any unfinished task business by marking where you.
        // stopped or ending the task outright.
        [application endBackgroundTask:bgTask];
        bgTask = UIBackgroundTaskInvalid;
    }];

    // Start the long-running task and return immediately.
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        // Do the work associated with the task, preferably in chunks.

        [application endBackgroundTask:bgTask];
        bgTask = UIBackgroundTaskInvalid;
    });
}

我想[这个链接][1]可能会对你有所帮助。[1]: