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. c# XML读取

    System.Xml 命名空间 https://msdn.microsoft.com/zh-cn/library/gg145036(v=vs.110).aspx 一.读取 1.通过 XmlDocume ...

  2. thymeleaf:字符串拼接+输出单引号

    代码: <a href="#" th:onclick="${'removeArticleImg('''+cmsImg.imgID+''')'}">删 ...

  3. scrapy入门二(分页抓取文章入库)

    分页抓取博客园新闻,先从列表里分析下一页按钮 相关代码: # -*- coding: utf-8 -*- import scrapy from cnblogs.items import Article ...

  4. 【linux】crontab无效解决办法

    参考来源:http://www.tennfy.com/3088.html 问题: 我在crontab中添加了一条定时任务 * * * sh test.sh 出乎意料的是,该定时任务并没有执行.可是我直 ...

  5. vs 加载 dll 缓慢

    https://jingyan.baidu.com/article/642c9d34e25cc2644b46f74b.html http://www.it610.com/article/2611781 ...

  6. MyEclipse、IDEA常用快捷键

    一.MyEclipse快捷键 1. ctrl+shift+r:打开资源这可能是所有快捷键组合中最省时间的了.这组快捷键可以让你打开你的工作区中任何一个文件,而你只需要按下文件名或mask名中的前几个字 ...

  7. 「SCOI2011」糖果

    蒟蒻又回来写题解了... 题面 幼儿园里有 N 个小朋友, lxhgww 老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果.但是小朋友们也有嫉妒心,总是会提出一些要求,比如小明不希望小红 ...

  8. adb shell 命令计算APP应用的 FPS 和评价流畅度。

    设计初衷: 1.面临用户和公司内领导试用中反馈的卡顿问题,思考如何能有效量化评估? 2.如何在尝试复现卡顿的过程中持续监控FPS和丢帧情况? 操作说明如下: (1)脚本源码的下载:(https://p ...

  9. 【Java】 大话数据结构(15) 排序算法(2) (快速排序及其优化)

    本文根据<大话数据结构>一书,实现了Java版的快速排序. 更多:数据结构与算法合集 基本概念 基本思想:在每轮排序中,选取一个基准元素,其他元素中比基准元素小的排到数列的一边,大的排到数 ...

  10. forEach的坑

    使用js里的forEach来遍历数组的时候需要注意的是:break,return语句不能使其中断,它还是会继续遍历完数组的每一个元素 错误代码: function nameExit(name){ da ...