我正在使用sharpie bind命令为bind的iOS库获取xamarin接口
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符号(我猜这是为@协议保留的)。如何使sharpie生成适当的api定义?
我能够删除所有的I前缀,并且编译成功,但我宁愿修复它,不要每次需要更新源代码库时都重复这一点。
谢谢
发布于 2016-04-07 01:23:13
请记住,所有obj-c协议都充当接口或抽象类,我建议将“协议、模型和基本类型设置为nsobject,另一件事是所有方法或属性都被定义为”必需“,您需要将其指定为抽象类。
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface myAwesomeDelegate
{
[Abstract]
[Export(...)]
void myRequiredMethod(uint param1)
[Export(...)]
void anotherMethod()
}希望这能帮助你解决你的问题
https://stackoverflow.com/questions/36448006
复制相似问题