Xamarin演练绑定iOS ObjC库时出现NSInvalidArgumentException错误

Xamarin演练绑定iOS ObjC库时出现NSInvalidArgumentException错误,xamarin,xamarin.ios,Xamarin,Xamarin.ios,我已经按照演练从中链接了Xamarin中的ObjC库 当我关闭colorpicker视图时,出现“无法识别的选择器发送到实例”错误 我发现了一些输入错误和小的修正,以使示例应用程序在关闭InfColorPicker视图时出错 我必须做的一个小修改是将Objective Sharper生成的StructsAndEnums.cs文件中的CGImageRef*更改为CGImage [DllImport ("__Internal")] static extern unsafe CGIma

我已经按照演练从中链接了Xamarin中的ObjC库

当我关闭colorpicker视图时,出现“无法识别的选择器发送到实例”错误

我发现了一些输入错误和小的修正,以使示例应用程序在关闭InfColorPicker视图时出错

我必须做的一个小修改是将Objective Sharper生成的StructsAndEnums.cs文件中的CGImageRef*更改为CGImage

    [DllImport ("__Internal")]
    static extern unsafe CGImageRef* createSaturationBrightnessSquareContentImageWithHue (float hue);

    [DllImport ("__Internal")]
    static extern unsafe CGImageRef* createHSVBarContentImage (InfComponentIndex barComponentIndex, float[] hsv);

在找到有关为Swift框架生成位代码的文档后,我尝试在XCode库中禁用位代码生成。我仍然会犯同样的错误

点击“完成”关闭视图后出现错误:

对于这个项目。
如果有用的话,我可以添加一个包含禁用位码生成的分支。

我使用的是从目标Sharpie输出生成的弱委托。我已将ViewController切换为使用WeakDelegate,而不是子类的强委托。我需要在ViewController中处理ColorPickerControllerdFinish消息

向ViewController添加以下函数修复了用户点击“完成”时出现的错误

    [DllImport ("__Internal")]
    static extern unsafe CGImage createSaturationBrightnessSquareContentImageWithHue (float hue);

    [DllImport ("__Internal")]
    static extern unsafe CGImage createHSVBarContentImage (InfComponentIndex barComponentIndex, float[] hsv);
    [Export("colorPickerControllerDidFinish:")]
    public void ColorPickerControllerDidFinish(InfColorPickerController controller)
    {
        View.BackgroundColor = controller.ResultColor;
        DismissViewController(false, null);

    }