且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MvvmCross Monotouch - 无法在真正的 iPad 上绑定属性,但它适用于模拟器

更新时间:2023-10-06 23:24:46

我见过这种类型的错误发生的一种情况是在发布版本中,单点链接器优化图像大小并删除绑定所需的明显未使用的属性.

One situation I've seen this type of error occur in is in release builds where the monotouch linker optimises the image size and removes the apparently unused property required for binding.

为了解决这个问题,我通常会包含一段假代码来欺骗链接器包含所需的属性 - 例如这是一个做同样事情的 monodroid 示例文件:

To workaround this, I generally include a fake bit of code to trick the linker into including the required properties - e.g. Here's a monodroid sample file which does the same sort of thing:

https://github.com/slodge/MvvmCross/blob/master/Sample%20-%20BestSellers/BestSellers/BestSellers.Droid/LinkerIncludePlease.cs

这是目前使用 mvvmcross 的缺点之一 - 它可能导致更大的二进制图像尺寸.

This is one of the disadvantages of using mvvmcross currently - it can lead to larger binary image sizes.