2014-09-29 87 views
1

好吧,我正在關注如何設置應用程序的Aviary文檔教程,但是我收到了兩個錯誤。Aviary SDK,代表問題

Errors
的代碼如下

- (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具有相同的代碼,但似乎工作正常。 有什麼我做錯了嗎?

回答

0

您需要指出您的委託類符合AFPhotoEditorControllerDelegate協議。

在您的.m中,通常在@implemenation行之前添加一個類擴展名(您可能已經有一個)。在那裏添加協議。

@interface ThirdViewController() <AFPhotoEditorControllerDelegate> 

@end 

@implementation ThirdViewController 

// all your existing stuff 

@end