绑定Objective-C程序包时出现错误 [英] Error when I bind an Objective-C Package

查看:54
本文介绍了绑定Objective-C程序包时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Xamarin项目中绑定一个Objective-C包.我遵循的步骤

那还不够.编译器将提示大量错误.如

你必须做点什么.例如,使用 ulong/long 而不是 nuint ,然后注释诸如 [Verify(MethodToProperty)] 之类的代码.和Xamarin.iOS在对象名称上有一些区别.例如,OC中的NSURL和C#中的NSUrl.您需要手动对其进行修改.

I want to bind an Objective-C Package in my Xamarin project. I follow the step from here. However,the content seems incomplete.And I want to know what to do next.Any advice will help me.

解决方案

Have you get two file(xxx_ApiDefinitions.cs and xxx_StructsAndEnums.cs )? Copy the code from two files to binding project.

That's not enough. The compiler will prompt a large number of errors . Such as

You have to do something. For example, use the ulong/long instead of nuint ,and annotate the code such as [Verify(MethodToProperty)] .In addition,there are some differences between iOS and Xamarin.iOS in name of Object.For example ,NSURL in OC and NSUrl in C#.You need to manually modify it.

这篇关于绑定Objective-C程序包时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆