新数据类型

NATIVE TYPE 32-BIT BACKING TYPE 64-BIT BACKING TYPE
System.nint System.Int32 (int) System.Int64 (long)
System.nuint System.UInt32 (uint) System.UInt64 (ulong)
System.nfloat System.Single (float) System.Double (double)
OLD TYPE IN SYSTEM.DRAWING NEW DATA TYPE DESCRIPTION
RectangleF CGRect Holds floating point rectangle information.
SizeF CGSize Holds floating point size information (width, height)
PointF CGPoint Holds a floating point, point information (X, Y)

检查平台架构

if (IntPtr.Size == ) {
Console.WriteLine ("32-bit App");
} else if (IntPtr.Size == ) {
Console.WriteLine ("64-bit App");
}

Arrays and System.Collections.Generic

 集合索引需要显示转换

public List<string> Names = new List<string>();
... public string GetName(nint index) {
return Names[(int)index];
}

DateTime 与 NSDate需要显示转换

下面两个扩展方法帮助实现隐式转换:

public static DateTime NSDateToDateTime(this NSDate date)
{
// NSDate has a wider range than DateTime, so clip
// the converted date to DateTime.Min|MaxValue.
double secs = date.SecondsSinceReferenceDate;
if (secs < -)
return DateTime.MinValue;
if (secs > )
return DateTime.MaxValue;
return (DateTime) date;
} public static NSDate DateTimeToNSDate(this DateTime date)
{
if (date.Kind == DateTimeKind.Unspecified)
date = DateTime.SpecifyKind (date, /* DateTimeKind.Local or DateTimeKind.Utc, this depends on each app */)
return (NSDate) date;
}

NSAction Replaced with Action

 

Custom delegates replaced with Action<T>

 

Task<bool> replaced with Task<Tuple<Boolean,NSError>>

Xamarin.iOS Unified API 注意要点的更多相关文章

  1. [Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考、NuGet组件参考

    [Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考.NuGet组件参考 解决方案 目前Visual Studio中最新版本的Xamarin.iO ...

  2. Xamarin迁移到 Unified API 注意事项

    参考官方文档: Migrating to Unified API for Components #if __UNIFIED__ ... // Mappings Unified CoreGraphic ...

  3. Xamarin.iOS项目提示error MSB3174:”TargetFrameworkVersion”的值无效

    Xamarin.iOS项目提示error MSB3174:”TargetFrameworkVersion”的值无效 错误信息:MSBulid\14.0\bin\Microsoft.Common.Cur ...

  4. 【Xamarin挖墙脚系列:Xamarin.IOS的程序的结构】

    原文:[Xamarin挖墙脚系列:Xamarin.IOS的程序的结构] 开始熟悉Xamarin在开发IOS的结构!!!!!!! 先看官方 这个是以一个单页面的程序进行讲述的. 1 程序引用的程序集,核 ...

  5. Xamarin.iOS,AOT,JIT,Limitations

    Since applications on the iPhone using Xamarin.iOS are compiled to static code, it is not possible t ...

  6. Visual Studio + C# + Xamarin = iOS/Android/Windows Apps

    Visual Studio 跨平台開發實戰 (1) -- Hello Xamarin! 前言 應用程式發展的腳步,從來沒有停過.從早期的 Windows 應用程式, 到網路時代的 web 應用程式,再 ...

  7. Xamarin iOS开发实战第1章使用C#编写第一个iOS应用程序

    Xamarin iOS开发实战第1章使用C#编写第一个iOS应用程序 C#原本是用来编写Windows以及Windows Phone的应用程序.自从Xamarin问世后.C#的作用就发生了非常大的变化 ...

  8. Xamarin.iOS开发初体验

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAAA+CAIAAAA5/WfHAAAJrklEQVR4nO2c/VdTRxrH+wfdU84pW0

  9. xamarin IOS 报错处理: an error occurred on client Build420719 while

    xamarin IOS 开发时如果报错如下: an error occurred on client Build420719 while...... 出现如下问题时,可能是1.丢失文件2.没有包括在项 ...

随机推荐

  1. Wireshark抓包工具

    首先下载并安装Wireshark软件,最好选择中文版,因为会使你用的更顺手. 安装完毕之后,双击打开Wireshark软件,主界面还是比较清晰明了的,可是怎么用还是稀里糊涂的吧. 点击菜单栏红圈中的选 ...

  2. JavaScript "自"运行-setInertval()和setTimeout()理解

    setInterval()和clearInterval() var result = "Y"; function onOk() { var tid = setInterval(fu ...

  3. 【GoLang】golang 最佳实践汇总

    最佳实践 1 包管理 1.1 使用包管理对Golang项目进行管理,如:godep/vendor等工具 1.2 main/init函数使用,init函数参考python 1.2.1 main-> ...

  4. spring quartz分布式任务计划

    spring quartz分布式任务计划 环境: 通过maven管理的spring mvc工程,且已经成功连接数据库. 数据库表结构 /*Table structure for table `qrtz ...

  5. Unity3D NGUI刮刮卡效果

    线上效果 确保你的纹理的read/write 是勾选的,纹理格式是 RGBA32的 //代码 using UnityEngine; [RequireComponent(typeof(UITexture ...

  6. ACM/ICPC 之 电力网络-EK算法(POJ1459)

    按照电站发电(从源点到电站),消费者消费(从消费者到汇点)的想法构建网络,以下是EK解法 //网络流EK算法 //Time:922Ms memory:224K #include<iostream ...

  7. Java设计模式之行为型模式

    行为型模式共11种:策略模式.模板方法模式.观察者模式.迭代子模式.责任链模式.命令模式.备忘录模式.状态模式.访问者模式.中介者模式.解释器模式. 策略模式:策略模式的决定权在用户,系统本身提供不同 ...

  8. Linux运维(3年以内)

    1.精通shell编程,熟练应用awk,sed,grep,strace,tcpdump等常用命令; 2.精通windows server,linux,mssql,mysql,熟悉网络,cisco,ju ...

  9. Error:identifer “blockIdx” and __syncthreads() undefined

    #include "device_launch_parameters.h" for blockIdx #include "device_functions.h" ...

  10. SQL语句汇总

    1.查询出来数据保留小数点2位,并且0.01时候,不会展示为.01. select     to_char(0.1,'fm9999999990.00') from dual; 2.wm_concat ...