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. python2.7中MySQLdb的安装与使用详解

    Python2.7中MySQLdb的使用 import MySQLdb #1.建立连接 connect = MySQLdb.connect( '127.0.0.1', #数据库地址 'root', # ...

  2. 【源码阅读】Mimikatz相关资料

    Mimikatz GitHub (源码) https://github.com/gentilkiwi/mimikatz Mimikatz GitHub Wiki (包含了一些说明文档) https:/ ...

  3. 【前端vue开发】vue开发输入姓名,电话,公司表单提交组件

    <template> <div id="parti-info"> <div> <span>您的姓名:</span> &l ...

  4. 我的CSS命名规则

    常见class关键词: 布局类:header, footer, container, main, content, aside, page, section 包裹类:wrap, inner 区块类:r ...

  5. 使用GIT管理UE4代码

    在OSCHINA的GIT上创建远程项目 cd existing_git_repo git init git add Onepass/ Source/ notes.txt git commit -m & ...

  6. 【LOJ】#2178. 「BJOI2017」机动训练

    题解 遇见平方和就转有序对呗 dp类似从很多点出发每次走一步的转移方式 然后我too naive的,枚举路径长度来决定更新次数,愉快TLE 改成记搜就过了 代码 #include <bits/s ...

  7. 第一次使用Git上传本地项目到github上

    对于程序原来说都听说过GitHub,GitHub有许多开源的的项目和一些前沿的技术.因为自己在刚刚开始使用Git把自己写的一些小dome放到GitHub上遇到许多的坑,这么长时间过去了,想对第一次使用 ...

  8. JAVA 画图板实现(基本画图功能+界面UI)一、界面实现

    /*文章中用到的代码只是一部分,需要源码的可通过邮箱联系我 1978702969@qq.com*/ 这段时间在学JAVA的swing界面开发,试着做了个画图板.实现了直线.曲线.喷枪.矩形.圆形.文字 ...

  9. 通俗讲解transform3D变换时css各属性的作用与搭配

    当没有浏览器兼容性限制时,就大胆地使用transiton的3D效果吧,前端也要做不一样的烟火! *常用的3D效果 rotateX/rotateY/rotateZ/rotate3dtranslateX/ ...

  10. python 实现结构体

    # python 使用类创建结构体 class Myclass(object): class Struct(object): def __init__(self, name, age, job): s ...