【问题标题】:Aviary SDK, delegate issueAviary SDK,委托问题
【发布时间】:2023-03-16 20:07:01
【问题描述】:

好的,我正在按照 Aviary 文档教程学习如何设置应用程序,但是我遇到了两个错误。


代码如下

- (void)displayEditorForImage:(UIImage *)image
{
static dispatch_once_t onceToken;

dispatch_once(&onceToken, ^{
    [AFPhotoEditorController setAPIKey:kAFAviaryAPIKey secret:kAFAviarySecret];
});

AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:image2];

[editorController setDelegate:self]; //error is here

[self presentViewController:editorController animated:YES completion:nil];}

错误是[editorController setDelegate:self];这行,返回上面的错误,我不知道怎么解决。 documentation 中提供的示例具有相同的代码,甚至 sample app 具有相同的代码但似乎工作正常。 是不是我做错了什么?

【问题讨论】:

    标签: objective-c image-processing delegates uiimageview aviary


    【解决方案1】:

    您需要表明您的委托类符合AFPhotoEditorControllerDelegate 协议。

    在您的 .m 文件中,通常就在 @implemenation 行之前,添加一个类扩展名(您可能已经有了一个)。在那里添加协议。

    @interface ThirdViewController () <AFPhotoEditorControllerDelegate>
    
    @end
    
    @implementation ThirdViewController
    
    // all your existing stuff
    
    @end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多