我想获得一个协议工作,但有一些问题。无法正确地获得协议设置
我的协议class.h
@protocol FormViewDelegate <NSObject>
// sent when the user selects a row in the recent searches list
@required
- (void)getDirections:(NSString*)address :(NSString*)cityStateZip;
@end
@interface BaseFormViewController : NSObject
@property (nonatomic, weak) id<FormViewDelegate> delegate;
@end
我viewcontroller.h
#import "BaseFormViewController.h"
@interface ViewController1 : <FormViewDelegate>
我viewcontroller.m
@implementation ViewController1
{
BaseFormViewController *baseProtocol;
}
- (IBAction)getDirections:(id)sender {
[baseProtocol getDirections:self.address.text :self.cityStateZip.text];
}
- (void)viewDidLoad
{
[super viewDidLoad];
baseProtocol = [[BaseFormViewController alloc]init];
baseProtocol.delegate = self;
...
}
我得到一个编译器错误指出:'BaseFormViewController'没有可见@interface声明选择器'getDirections ::'我在这里做错了什么?
我在需要或没有我仍然得到一个生成错误 – BluGeni
你得到什么错误? –