Ok, so I'm following the Aviary Documentation Tutorial on how to setup an app, however I'm getting two errors.
The code is as follows
- (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];}
The error is the line [editorController setDelegate:self];
, which returns the above error, I don't know how to fix this.
The example provided in the documentation has the same code and even the sample app has the same code but seems to work fine.
Is there something I'm doing wrong?
You need to indicate that your delegate class conforms to the AFPhotoEditorControllerDelegate
protocol.
In your .m, usually just before the @implemenation
line, add a class extension (you may already have one). Add the protocol there.
@interface ThirdViewController () <AFPhotoEditorControllerDelegate>
@end
@implementation ThirdViewController
// all your existing stuff
@end