"THREAD WARNING: ['Console'] took '81.661865' ms. Plugin should use a background thread."
在跑步的时候iOS 手机差距项目。对于一些剩余的插件(例如地理位置和文件系统)也是如此。
由于我是 Phonegap 的新手,请任何人告诉我如何在后台线程上运行该插件。
我检查过this https://github.com/Moodstocks/moodstocks-phonegap-plugin/issues/17 also.
我们可以忽略这个线程警告还是与 iOS Phone-gap 中的内存问题有关
thanks
As per this http://www.telerik.com/forums/issue-in-iphone-using-jquery-mobile-resetting-plugins-due-to-page-load-#mhabK7SbHUefPmNonZJHVg。解决了我的警告问题
我发现可以忽略警告。但这可以通过使用此循环添加后台线程来解决:(在 CDVLogger.m 中)
[self.commandDelegate runInBackground:^{
//add your code here
}
现在控制台警告如下所示:
- (void)logLevel:(CDVInvokedUrlCommand*)command
{
[self.commandDelegate runInBackground:^{
id level = [command argumentAtIndex:0];
id message = [command argumentAtIndex:1];
if ([level isEqualToString:@"LOG"]) {
NSLog(@"%@", message);
} else {
NSLog(@"%@: %@", level, message);
}
}];
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)