我正在尝试将没有直接类的返回类型映射到 MonoTouch 中的某些东西(因为我不确定等价的东西是什么)。
例如,如果在 btouch 中我想绑定结果类型 UIView < ProtocolX > 定义如下:
- (UIView< ProtocolThing > *)addThing:(Thing *)aThing;
我已经成功地做到了:
[Export("addThing:")] UIView AddThing(Thing aThing);
除了我无法获得 ProtocolThing 扩展。如果我创建一个像 UIViewProtocolThing 这样的中间类型:
//@interface UIViewProtocolThing : UIView { [BaseType (typeof (UIView))] 接口 UIViewProtocolThing : ProtocolThing { ... }
我可以使用 UIViewProtocolThing,但由于它为 UIViewProtocolThing 创建构造函数并且这些构造函数不存在,因此返回此类型失败。
有人对此有想法吗?