在Monotouch中创建协议/代理

在Monotouch中创建协议/代理,mono,xamarin.ios,Mono,Xamarin.ios,我对如何在Monotouch中创建自定义协议/委托类型有点困惑 obj-c等效物为 @protocol CellController - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath (NSIndexPath *)indexPath; @optional - (void)tableView:(UITableView *)tableView didSelectRowAtInd

我对如何在Monotouch中创建自定义协议/委托类型有点困惑

obj-c等效物为

@protocol CellController
   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath (NSIndexPath *)indexPath;
   @optional
   - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end
实现必须是抽象类、接口还是什么

我相信这并不复杂,我就是想不起来。一个代码示例会很有帮助,但是指出正确的方向仍然非常有帮助

干杯


R

所以我最后做的是创建一个接口并使用它:

我相信是的,我需要将cellcontroller定义为委托类型。这些方法只是一个例子。如果我想创建一个uitableview委托,正如您所说,我可以从UITableViewDelegates继承。您尝试创建的此委托类型将用作现有iOS对象上的委托对象,还是用作新的自定义对象?