有关Aviary SDK的问题

在ios中使用Aviary SDK,我按照教程中的步骤进行,但是在调用Viewdidload中的方法:

- (void)displayEditorForImage:(UIImage *)imageToEdit
{
    AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];
    [editorController setDelegate:self];
    [self presentViewController:editorController animated:YES completion:nil];
}

报出了如下警告:

Warning: Attempt to present <AFSDKViewController: 0x7e1aeb0> on <ViewController: 0x7934af0> whose view is not in the window hierarchy!

谢谢。

如果你Modal View Controller在ViewDidLoad 中,出现这样的错误是由于view还没有加载到窗体框架中。你可以在viewDidAppear中调用那个方法。

但是如果每次view显示都如此就会调用displayEditorForImagemethod