Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.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上的Cordova:在演示过程中尝试在控制器上演示_Ios_Cordova - Fatal编程技术网

iOS上的Cordova:在演示过程中尝试在控制器上演示

iOS上的Cordova:在演示过程中尝试在控制器上演示,ios,cordova,Ios,Cordova,我遇到了一个问题,我在Cordova应用程序中选择了一个图像,然后当成功选择该图像时,我的插件应该启动一个照片编辑器 以下是我的插件中show方法的代码: - (void) show:(CDVInvokedUrlCommand*) command { NSString* arg0 = [command.arguments objectAtIndex:0]; NSURL* url = [NSURL URLWithString:arg0]; NSString* imageP

我遇到了一个问题,我在Cordova应用程序中选择了一个图像,然后当成功选择该图像时,我的插件应该启动一个照片编辑器

以下是我的插件中show方法的代码:

- (void) show:(CDVInvokedUrlCommand*) command
{
    NSString* arg0 = [command.arguments objectAtIndex:0];

    NSURL* url = [NSURL URLWithString:arg0];
    NSString* imagePath = [url path];
    UIImage* image = [UIImage imageWithContentsOfFile:imagePath];

    self.aviary = [[AFPhotoEditorController alloc] initWithImage:image];
    [self.aviary setDelegate:self];
    [self.viewController presentModalViewController:self.aviary animated:YES];
}
照片编辑器不显示,出现以下警告:

正在进行演示时,尝试在MainViewController:0x9fc9780上演示AFSDKViewController:0x9e73470

因此,如果我像下面这样给我的插件调用添加延迟,那么照片编辑器就可以启动了,但是我不希望在我的代码中只为iOS添加延迟。避免这种竞争状况的正确方法是什么

setTimeout(function() {
    // code that calls my photo editor plugin
}, 1000);