新数据类型

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>>

最新文章

  1. 【Java EE 学习 76 上】【数据采集系统第八天】【角色授权】【用户授权】【权限的粗粒度控制】【权限的细粒度控制】
  2. BestCoder22 1003.NPY and shot 解题报告
  3. C++ GPU &amp;&amp; CPU
  4. Makefile技术和应用总结
  5. JAVA 主函数(主方法)
  6. WPF拖动DataGrid中的数据到ListBox
  7. 可灵活扩展的自定义Session状态存储驱动
  8. Android(java)学习笔记91:泛型接口的概述和使用
  9. 常用js代码学习
  10. APUE读书笔记-第14章-高级I/O
  11. Linux操作系统定时任务系统Cron入门、PHP计划任务以及rpc示例
  12. Finding awesome developers in programming interviews(转)
  13. MVC4
  14. Linux程序设计综合训练之简易Web服务器
  15. EntityFrameworkCore v1.1.1 问题汇总
  16. junit4X系列源码--总体介绍
  17. numpy教程:排序、搜索和计数
  18. mongodb不断刷日志的问题
  19. &lt;二&gt;企业级开源仓库nexus3实战应用–使用nexus3配置docker私有仓库
  20. python全栈开发 * 26知识点汇总 * 180709

热门文章

  1. [BZOJ3262]陌上花开
  2. jQuery解析AJAX返回的html数据时碰到的问题与解决
  3. TypeError: datetime.datetime(2016, 9, 25, 21, 12, 19, 135649) is not JSON serializable解决办法
  4. 序列化对象为xml字符串
  5. Count Complete Tree Nodes
  6. 提额 APP
  7. SSO 单点登录实现
  8. iOS - 模拟器
  9. IIS使用Tip
  10. Ring3下的DLL注入(NtCreateThreadEx + LdrLoadDll方式实现,可以注入系统进程)