I had been happily coding an iOS app (targeting iPad) using Xamarin/VS.Net with everything working fine when debugging in the iOS simulator, however as soon as I started trying to push the app to a physical device (iPad 4th gen) I started getting problems.

Problem 1 – failed to resolve System.Linq.Expressions.MethodCallExpression

The IOC framework I was using was internally using Linq expressions to construct objects. This in turn invokes some form of JIT compilation which is not allowed on iOS. (To be fair the IOC framework didn’t specifically support Monotouch, but I recompiled as a PCL and referenced it from my iOS project and all seemed to be working fine in the iOS simulator).

To fix the problem I switched out the IOC framework with TinyIoC (a simple IOC container that you can include in your project by including a single cs file – nice!).

Problem 2 – Attempting to JIT compile method ‘…’ while running with –aot-only

The ‘…’ in the error message (which has been stripped out for readability) was reference to a generic method. Even though Xamarin.iOS 6.4 includes “iOS generic compiler improvements” resulting in “fewer ‘Attempting to JIT compile method’ errors” it turns out that it didn’t like generics in one particular method that I had in the code base. (I haven’t been able to figure out exactly why this use of generics was any different to other usages).

To fix the problem I rewrote the offending code without using generics.

Thoughts

I’m loving being able to build iOS apps using familiar tools (VS.Net) and languages (C#) but it helps to be aware of some of the potential gotchas. More (hopefully not too many more) to come…

Xamarin adventures – Differences between iOS simulator and device的更多相关文章

  1. iOS Simulator功能介绍关于Xamarin IOS开发

    iOS Simulator功能介绍关于Xamarin IOS开发 iOS Simulator功能介绍 在图1.38所示的运行效果中,所见到的类似于手机的模型就是iOS Simulator.在没有iPh ...

  2. Appium+python自动化19-iOS模拟器(iOS Simulator)安装自家APP

    前言 做过iOS上app测试的小伙伴应该都知道,普通用户安装app都是从appstore下载安装,安装测试版本的app,一般就是开发给的二维码扫码安装, 或者开发给个.ipa的安装包文件,通过itoo ...

  3. Appium+python自动化19-iOS模拟器(iOS Simulator)安装自家APP【转载】

    前言 做过iOS上app测试的小伙伴应该都知道,普通用户安装app都是从appstore下载安装,安装测试版本的app,一般就是开发给的二维码扫码安装, 或者开发给个.ipa的安装包文件,通过itoo ...

  4. open an iOS simulator from the terminal

    open an iOS simulator from the terminal # simulator $ open -a Simulator flutter https://flutter.dev/ ...

  5. NewRelicAgent(CustomAnalyticEvent.cxx.o), building for iOS simulator, but linking in object file built for OSX, for architecture x8(botched)

    昨天遇到一个问题,在项目swift1.2适配swift2.0的过程中,修改完毕之后,运行报错如下: /Pods/NewRelicAgent/NewRelic_iOS_Agent_5.1.0/NewRe ...

  6. 【转】Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得

    iOS模拟器简介 iOS功能简介 iOS模拟器,是在Mac下面开发程序时,开发iOS平台的程序时候,可以使用的辅助工具. 其功能是,帮你模拟iOS平台设备,在模拟器上运行对应的程序,以方便你没有实体设 ...

  7. 【Xamarin 挖墙脚系列:IOS 开发界面的3种方式】

    原文:[Xamarin 挖墙脚系列:IOS 开发界面的3种方式] xcode6进行三种基本的界面布局的方法,分别是手写UI,xib和storyboard.手写UI是最早进行UI界面布局的方法,优点是灵 ...

  8. iOS 把图片从Mac本地添加到iOS Simulator中

    [把图片从Mac本地添加到iOS Simulator中] 1. 把图片从Mac本机拖动到iOS Simulator中: 2. iOS Simulator会自动打开Safari去打开对应的图片,然后你用 ...

  9. iOS Simulator 模拟器 与 Android Emulator 仿真器:为什么叫不同的英文名字?(待补充)

    iOS Simulator 模拟器 与 Android Emulator 仿真器:为什么叫不同的英文名字?(待补充)

随机推荐

  1. linux笔记_day09

    1.运算器.控制器.存储器.输入输出(IO) 地址总线:内存寻址 数据总线:传输数据 控制总线:控制指令 寄存器:cpu暂时存储器 2.系统设定 默认输出设备:标准输出,STDOUT,1(描述符)(显 ...

  2. BAT获取FTP指定文件

    以下两个文件放在同一目录下 getfile.bat文件内容如下: @echo offftp.exe -i -s:getfile.txt 192.168.1.2(更换成你的ip,参数之间有空格)paus ...

  3. 优化MySQL的21个建议 – MySQL Life【转】

    今天一个朋友向我咨询怎么去优化 MySQL,我按着思维整理了一下,大概粗的可以分为21个方向. 还有一些细节东西(table cache, 表设计,索引设计,程序端缓存之类的)先不列了,对一个系统,初 ...

  4. Linux6.5 安装Python3.X(转载)

    1.获取Python 3.6.3 通过官网https://www.python.org/downloads/下载Python 3.4.3源码: 源码获取命令如下:wget https://www.py ...

  5. elasticsearch常见异常及解决办法

    报错信息:Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 20602552 ...

  6. springboot自定义SpringApplication启动类

    如果默认的SpringApplication不符合你的口味,你可以创建一个本地的实例并自定义它.例如,关闭banner你可以这样写: public static void main(String[] ...

  7. @PostConstruct和@PreConstruct

    详情参见:https://www.cnblogs.com/landiljy/p/5764515.html 1.@PostConstruct说明 被@PostConstruct修饰的方法会在服务器加载S ...

  8. 数组slice方法

    slice slice(start,end):方法可从已有数组中返回选定的元素,返回一个新数组,包含从start到end(不包含该元素)的数组元素.(不会改变原数组) start参数:必须,规定从何处 ...

  9. 【转】使用import scope解决maven继承(单)问题

    http://blog.csdn.net/mn960mn/article/details/50894022 测试环境 maven 3.3.9 想必大家在做SpringBoot应用的时候,都会有如下代码 ...

  10. 020.Zabbix的Actions配置

    一 Action概述 当产生Trigger后,即当触发器条件被满足时,采取一些操作,如发送事件通知,远程执行命令等,需要配置Action.   名称 作用 Trigger 当Trigger的状态从OK ...