我正在尝试将objective-c库与委托绑定
@protocol PKTokenFieldDelegate <UITextFieldDelegate>
-(void)tokenShouldChangeHeight:(CGFloat)height;
@optional
-(void)tokenFieldDidSelectToken:(PKToken*)token;
-(void)tokenFieldDidBeginEditing:(PKTokenField*)tokenField;
-(void)tokenFieldDidEndEditing:(PKTokenField*)tokenField;
@end
Sharpie 输出基于 xamarin 开发人员网站上的演练。
// @protocol PKTokenFieldDelegate <UITextFieldDelegate>
[BaseType (typeof (NSObject))]
[Model]
interface PKTokenFieldDelegate : IUITextFieldDelegate
{
// @required -(void)tokenShouldChangeHeight:(CGFloat)height;
[Abstract]
[Export ("tokenShouldChangeHeight:")]
void TokenShouldChangeHeight (nfloat height);
// @optional -(void)tokenFieldDidSelectToken:(PKToken *)token;
[Export ("tokenFieldDidSelectToken:")]
void TokenFieldDidSelectToken (PKToken token);
// @optional -(void)tokenFieldDidBeginEditing:(PKTokenField *)tokenField;
[Export ("tokenFieldDidBeginEditing:")]
void TokenFieldDidBeginEditing (PKTokenField tokenField);
// @optional -(void)tokenFieldDidEndEditing:(PKTokenField *)tokenField;
[Export ("tokenFieldDidEndEditing:")]
void TokenFieldDidEndEditing (PKTokenField tokenField);
}
这只会创建一个我可以继承的对象,而不是创建一个接口。我需要把它作为一个接口。我错过了什么?
谢谢