【发布时间】:2016-04-06 10:11:27
【问题描述】:
我正在使用sharpie bind 命令为xamarin 的iOS 库获取API 接口
sharpie bind --namespace=XXX --sdk=iphoneos9.2 Headers/*.h
@protocol 绑定有问题:
The type or namespace name `IProfileDelegate' could not be found. Are you missing an assembly reference?
它是这样生成的:
interface XLibrary : IProfileDelegate
{
[Wrap ("WeakProfileDelegate")]
[NullAllowed]
MB_ProfileDelegate ProfileDelegate { get; set; }
我知道它会创建空的 ProfileDelegate 然后编译器或其他东西用方法填充它,但我的问题是找不到 IProfileDelegate。
@protocol ProfileDelegate <NSObject>
@required
- (void)GetProfileFinished:(NSString*)_data;
- (void)SetProfileFinished:(NSString*)_data;
@end
I 符号的区别(我猜这是为@protocols 保留的)。
如何让sharpie生成正确的api定义?
我能够删除所有 I 前缀并且它编译成功,但我宁愿修复它,不要在每次需要更新源库时重复此操作。
谢谢
【问题讨论】: