【发布时间】:2018-08-28 18:33:15
【问题描述】:
经过一番摸索,我终于得到了objective-sharpie,成功绑定了.framework文件,但是它生成的ApiDefinition.cs文件包含一些不规则。
// @optional -(void)flyerView:(WFKFlyerView * _Nonnull)flyerView gotSingleTap:(id<WFKFlyerViewTapAnnotation> _Nullable)annotation atPoint:(CGPoint)point;
[Export("flyerView:gotSingleTap:atPoint:")]
void FlyerView(WFKFlyerView flyerView, [NullAllowed] WFKFlyerViewTapAnnotation annotation, CGPoint point);
// @optional -(void)flyerView:(WFKFlyerView * _Nonnull)flyerView gotDoubleTap:(id<WFKFlyerViewTapAnnotation> _Nullable)annotation atPoint:(CGPoint)point;
[Export("flyerView:gotDoubleTap:atPoint:")]
void FlyerView(WFKFlyerView flyerView, [NullAllowed] WFKFlyerViewTapAnnotation annotation, CGPoint point);
// @optional -(void)flyerView:(WFKFlyerView * _Nonnull)flyerView gotLongPress:(id<WFKFlyerViewTapAnnotation> _Nullable)annotation atPoint:(CGPoint)point;
[Export("flyerView:gotLongPress:atPoint:")]
void FlyerView(WFKFlyerView flyerView, [NullAllowed] WFKFlyerViewTapAnnotation annotation, CGPoint point);
所以这实际上不会编译,因为 Visual Studio 恰当地指出,尽管具有不同的 [Export] 属性,但这些方法具有完全相同的定义。我尝试更改它,因此只有一个具有多个 [Export] 属性的方法,但这也是不允许的。不知道在这里做什么。
顶部还有一个 using 声明,我认为它试图指向我在 Visual Studio for Mac 的 Xamarin 项目中设置的 Native Reference,但它不起作用 (type or namespace could not be found are you missing an assembly reference, etc.)
非常感谢任何帮助!
【问题讨论】:
标签: xamarin xamarin.forms xamarin.ios objective-sharpie xamarin.ios-binding