Xamarin adventures – Differences between iOS simulator and device
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的更多相关文章
- iOS Simulator功能介绍关于Xamarin IOS开发
iOS Simulator功能介绍关于Xamarin IOS开发 iOS Simulator功能介绍 在图1.38所示的运行效果中,所见到的类似于手机的模型就是iOS Simulator.在没有iPh ...
- Appium+python自动化19-iOS模拟器(iOS Simulator)安装自家APP
前言 做过iOS上app测试的小伙伴应该都知道,普通用户安装app都是从appstore下载安装,安装测试版本的app,一般就是开发给的二维码扫码安装, 或者开发给个.ipa的安装包文件,通过itoo ...
- Appium+python自动化19-iOS模拟器(iOS Simulator)安装自家APP【转载】
前言 做过iOS上app测试的小伙伴应该都知道,普通用户安装app都是从appstore下载安装,安装测试版本的app,一般就是开发给的二维码扫码安装, 或者开发给个.ipa的安装包文件,通过itoo ...
- open an iOS simulator from the terminal
open an iOS simulator from the terminal # simulator $ open -a Simulator flutter https://flutter.dev/ ...
- 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 ...
- 【转】Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得
iOS模拟器简介 iOS功能简介 iOS模拟器,是在Mac下面开发程序时,开发iOS平台的程序时候,可以使用的辅助工具. 其功能是,帮你模拟iOS平台设备,在模拟器上运行对应的程序,以方便你没有实体设 ...
- 【Xamarin 挖墙脚系列:IOS 开发界面的3种方式】
原文:[Xamarin 挖墙脚系列:IOS 开发界面的3种方式] xcode6进行三种基本的界面布局的方法,分别是手写UI,xib和storyboard.手写UI是最早进行UI界面布局的方法,优点是灵 ...
- iOS 把图片从Mac本地添加到iOS Simulator中
[把图片从Mac本地添加到iOS Simulator中] 1. 把图片从Mac本机拖动到iOS Simulator中: 2. iOS Simulator会自动打开Safari去打开对应的图片,然后你用 ...
- iOS Simulator 模拟器 与 Android Emulator 仿真器:为什么叫不同的英文名字?(待补充)
iOS Simulator 模拟器 与 Android Emulator 仿真器:为什么叫不同的英文名字?(待补充)
随机推荐
- 【API】注册表编程基础-RegCreateKeyEx、RegSetValueEx
1.环境: 操作系统:Windows 10 x64 编译器:VS2015 2.关键函数 LONG WINAPI RegCreateKeyEx( _In_ HKEY hKey, _In_ LPCTSTR ...
- C#使用redis学习笔记
1.官网:http://redis.io/(英) http://www.redis.cn/(中) 2.下载:https://github.com/dmajkic/redis/downloads(Wi ...
- poj2679
题意:给出一个有向图,每条边有两个属性:一个长度一个费用.费用可能是负数.长度一定是非负的.给出一个起点和一个终点,现要求,从起点走到终点,且从每个点走出时选择的那条边必须是以该点作为起点的边中费用最 ...
- 不使用第三方软件、使用IE11自带功能来屏蔽浏览器广告
第一步: 下载后面的附件http://files.cnblogs.com/limits/IE11%E5%8E%BB%E5%B9%BF%E5%91%8A.zip 打开此路径IE11跟踪保护+CSS去广告 ...
- 深入理解java虚拟机-00
这本书买了有两年了,只有买回来翻了两页...今天电脑有点卡,游戏玩不了了,就来看看这本书. 首先看了序言,这本书是第二版,讲解的jdk版本是1.7,现在公司用的1.8,而且1.8的改动也挺大的,不过在 ...
- Codeforces 219C Color Stripe(思维+字符串)
题目链接:http://codeforces.com/problemset/problem/219/C 题目大意: 给出一个字符串,只包含k种字符,问最少修改多少个字符(不增长新的种类)能够得到一个新 ...
- java判断部署项目使用的服务器类型
有两种方式 1.项目引入portal-kernel.jar.项目运行时使用 根据返回boolean值判断类型! 2.自己写java类 package webService.ZFGX.service; ...
- EntityFramework系列:SQLite的CodeFrist和RowVersion
没什么好说的,能支持DropCreateDatabaseIfModelChanges和RowVersion的Sqlite谁都想要.EntityFramework7正在添加对Sqlite的支持,虽然EF ...
- 【AtCoder】AGC029(A-E)
A - Irreversible operation 题解 把每个B后面的W个数累加起来即可 代码 #include <bits/stdc++.h> #define fi first #d ...
- zookeeper集群自动启动脚本
定义脚本boot.sh启动zookeeper集群(hadoop1,hadoop2,hadoop3) #!/bin/bash echo "start zkServer..." do ...