【发布时间】:2012-11-08 19:54:18
【问题描述】:
我正在尝试将我的第一个 3th 方库绑定到我的 monotouch 项目。大多数绑定都有效,但我在绑定目标 C 类扩展时遇到了麻烦。我知道Binding Objective-C Types 文档中的“绑定类扩展”部分,但不幸的是它并没有帮助我。
这些是我要绑定的 2 个扩展:
// category on UIViewController to provide access to the viewDeckController in the
// contained viewcontrollers, a la UINavigationController.
@interface UIViewController (UIViewDeckItem)
@property(nonatomic,readonly,retain) IIViewDeckController *viewDeckController;
@end
// category on WrappedController to provide access to the viewDeckController in the
// contained viewcontrollers, a la UINavigationController.
@interface UIViewController (WrapControllerItem)
@property(nonatomic,readonly,assign) WrapController *wrapController;
@end
这就是我试图绑定它们的方式:
[BaseType (typeof(UIResponder))]
interface UIViewController
{
[Export ("viewDeckController", ArgumentSemantic.Retain)]
IIViewDeckController ViewDeckController { get; set; }
[Export ("wrapController", ArgumentSemantic.Assign)]
WrapController WrapController { get; set; }
}
然后当我尝试在我的应用程序中编译它时:
公共部分类 AgendaView : UIViewController
我收到以下错误:
'UIViewController' 是 'MonoTouch.UIKit.UIViewController' 和 'ViewDeck.UIViewController' 之间的模糊引用
我试图在网上搜索解决方案,但找不到,所以如果有人能进一步帮助我,我会很高兴。
提前致谢
【问题讨论】:
-
Guido 运气好吗?我想我被困在同一个第三方库映射上:-(
-
尝试做同样的事情,运气好吗?
-
大家好,很抱歉回复晚了..但我被困在了这个问题上。我终于找到了其他一些我可以使用的用 C# 编写的组件。但我相信 Xamarin 更容易做到这一点,请参阅链接:Objective Sharpie