我正在尝试将我的第一个第三方库绑定到我的monotouch项目。大多数绑定都可以工作,但我在绑定Objective 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”之间的不明确引用
我试着在网上搜索这个问题的解决方案,但我找不到,所以如果有人能进一步帮助我,我会很高兴。
提前感谢
发布于 2012-11-09 05:17:29
您必须指定名称空间。显式的:
public partial class AgendaView : MonoTouch.UIKit.UIViewController
public partial class AgendaView : MyBindingsNamespace.UIViewController或由using提供
using MyBindingsNamespace;
public partial class AgendaView : UIViewControllerhttps://stackoverflow.com/questions/13296707
复制相似问题