Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.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
Ios 线程警告-phonegap_Ios_Cordova_Dialog_Phonegap Plugins - Fatal编程技术网

Ios 线程警告-phonegap

Ios 线程警告-phonegap,ios,cordova,dialog,phonegap-plugins,Ios,Cordova,Dialog,Phonegap Plugins,线程警告:['Notification']take'1153.449951'ms。插件应使用后台线程。 如何解决?请帮帮我 Cordova的官方文件指出: 如果你的插件需要大量的处理或者需要阻塞调用,你应该使用后台线程 使用如下代码: - (void)myPluginMethod:(CDVInvokedUrlCommand*)command { // Check command.arguments here. [self.commandDelegate runInBackgrou

线程警告:['Notification']take'1153.449951'ms。插件应使用后台线程。
如何解决?请帮帮我

Cordova的官方文件指出:

如果你的插件需要大量的处理或者需要阻塞调用,你应该使用后台线程

使用如下代码:

- (void)myPluginMethod:(CDVInvokedUrlCommand*)command
{
    // Check command.arguments here.
    [self.commandDelegate runInBackground:^{
        NSString* payload = nil;
        // Some blocking logic...
        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload];
        // The sendPluginResult method is thread-safe.
        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
    }];
}

谢谢你的回答。但是我试过了!没有成功。