1

我在 ios 项目中使用 Aviary sdk。我添加了文档中提到的所有框架和头文件。现在我在 viewdidload 中调用下面的方法。

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

但它在日志下面给出警告并且不显示 Aviary 窗口。

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

我如何在我的项目中集成 aviary sdk

4

1 回答 1

1

如果您在 ViewDidLoad 中显示模态视图控制器,则会发生错误,因为视图仍未加载到寡妇层次结构中。您可以在 viewDidAppear 中调用该方法。

但是,如果每次视图出现时都这样做,displayEditorForImage则会调用方法。

于 2013-01-23T11:27:05.307 回答