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

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

问题描述

我想在我的 Xamarin 项目中绑定一个 Objective-C 包.我按照步骤从

这还不够.编译器会提示大量错误.比如

你必须做点什么.例如,使用 ulong/long 代替 nuint ,并在代码中注释如 [Verify(MethodToProperty)] .另外,还有iOS 和 Xamarin.iOS 在 Object 名称上的一些区别.例如,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天全站免登陆