预期';' 在'''令牌错误之前

1 iphone compiler-errors objective-c ios

在我编写代码时,显示的错误是预期';' 在'('标记之前.
这是我指向错误的代码部分.

@class UITableViewCellEditable;

@protocol UITableViewCellEditableDelegate
- (void)editDidFinish:(NSMutableDictionary *)result //    (in this line of code)
{ 
    [userDataSource setValue:[result objectForKey:@"text"]
               forKey:[result objectForKey:@"key"]];
}
@optional
Run Code Online (Sandbox Code Playgroud)

我尝试了一些可能性,但仍然是同样的错误!我怎么处理它?

gse*_*mpe 6

您无法在@protocol块中定义方法.它只适用于声明.