我正在尝试使用MonoTouch btouch工具绑定协议
Objective-C协议:
@protocol KalDataSource <NSObject, UITableViewDataSource>
- (void)presentingDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate delegate:(id<KalDataSourceCallbacks>)delegate;
- (NSArray *)markedDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate;
- (void)loadItemsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;
- (void)removeAllItems;
@end
BTouch绑定:
[BaseType(typeof(UITableViewDataSource)]
interface KalDataSource {
...
}
但这会导致btouch错误:
error CS0534: `Kal.KalDataSource' does not implement inherited abstract member...
缺少的成员当然是GetCell和RowsInSection。我想创建一个KalDataSource的部分类实现,但仍需要让消费者虚拟定义这些方法。 HALP?
更新:在澄清后,似乎无法立即绑定从其他UIKit协议“继承”的协议。我在这里提出了一个错误:
答案 0 :(得分:0)
使用最新版本的btouch,您可以列出您实施的协议,在这种情况下,如下所示:
[BaseType (typeof (NSObject))]
interface KalDataSource : UITableViewDataSource {
}
请注意,这是使用[BaseType]和NSObject,它将是它的子类,而是从UITableViewDataSource内联方法。