C# unmanaged function pointers for iOS

Just a reminder to myself when I need this thing next time for making Unity work with native code:

  • delegate method should be static to please AOT compiler required for iOS
  • method should have have [MonoPInvokeCallback(typeof(YourDelegate))] attribute. its code is as simple as this:

    [AttributeUsage (AttributeTargets.Method)]
    public sealed class MonoPInvokeCallbackAttribute : Attribute
    {
    public MonoPInvokeCallbackAttribute (Type t) {}
    }
  • for other platforms, delegate should have [UnmanagedFunctionPointer(YourCallingConvention)] attribute, but for iOS it prevents AOT compilation for some reason, so we need to #if it

From : http://nadako.tumblr.com/post/82111636787/c-unmanaged-function-pointers-for-ios

C# unmanaged function pointers for iOS的更多相关文章

  1. new thoughts over function pointers

    Previous works do not relate to function pointers, but reading some documents reading and learning S ...

  2. Function Pointers in C

    来源:https://cs.nyu.edu/courses/spring12/CSCI-GA.3033-014/Assignment1/function_pointers.html Function ...

  3. C语言基础:函数(Function) 分类: iOS学习 c语言基础 2015-06-10 21:48 14人阅读 评论(0) 收藏

    函数:一段具有某些特定功能的代码段. 使用函数的严格规定: 1.函数声明 2.函数定义 3.函数调用 函数声明:告知系统编译器该系统的函数名,函数参数,参数类型,参数个数,参数顺序等等,以便函数调用时 ...

  4. [转] iOS ABI Function Call Guide

    source: apple ARMv6 Function Calling Conventions When functions (routines) call other functions (sub ...

  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. Xamarin/Mono IOS Limitations

    http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ Since applications on the iPhon ...

  7. [转]ARM64 Function Calling Conventions

    from apple In general, iOS adheres to the generic ABI specified by ARM for the ARM64 architecture. H ...

  8. [转]Passing Managed Structures With Strings To Unmanaged Code Part 1

    1. Introduction. 1.1 Managed structures that contain strings are a common sight. The trouble is that ...

  9. Using Blocks in iOS 4: The Basics

    iOS 4 introduces one new feature that will fundamentally change the way you program in general: bloc ...

随机推荐

  1. 解决 samba不允许一个用户使用一个以上用户名与一个服务器或共享资源的多重连接

    net use * /del /y http://www.cnblogs.com/senior-engineer/p/4528378.html

  2. HttpModule与HttpHandler详解

    ASP.NET对请求处理的过程:当请求一个*.aspx文件的时候,这个请求会被inetinfo.exe进程截获,它判断文件的后缀(aspx)之后,将这个请求转交给 ASPNET_ISAPI.dll,A ...

  3. C#-WinForm-跨窗体 构造函数传值 及应用—登录式窗口传值、如何关闭主页面时关闭应用程序、如何打开唯一窗口—★★★★★五星重量级

    构造函数可以传任意类型的值,并可以同时传多个值 结构函数传值的初步应用--简单的登陆式界面 现在我有两个窗体Form3和Form4,如下,如何点击Form3中的按钮后,打开Form4并将Form3中的 ...

  4. wamp 中如何管理两个dedeCms站点

    本文以WampServer2.1为例,图文说明开启wamp虚拟主机功能,也就是绑定多域名,开启多站点搭建功能. 1.  我们一键安装wamp到E盘,并可以正常启动,状态如下图所示:  

  5. 【POJ 2406】Power Strings(KMP循环节)

    终于靠着理解写出KMP了,两种KMP要代码中这种才能求循环节.i-next[i]就是循环节. #include<cstdio> #define N 1000005 char s[N]; i ...

  6. Urtext的使用

    UITextField 是UIControl的子类,UIControl又是UIView的子类,所以也是一个视图,只不过比UIView多了两个功能,1.文字显示,2.文本编辑 使用过程分四步: 1.创建 ...

  7. Python字符串基础一

    下一篇:Python 序列通用操作介绍 写在前面 下学期开始上计算机网络的课程,现在已经在看相关书籍,希望结合python写出一个网络爬虫程序.利用学习C++后的空余时间来看看Python并在这里总结 ...

  8. css-关于absolute和relative的一些笔记

    根据张鑫旭老师的博客,一些笔记留作备忘 1.position:absolute 具有包裹性--包裹性换种说法就是让元素inline-block化,例如一个div标签默认宽度是100%显示的,但是一旦被 ...

  9. 【bzoj1433】 ZJOI2009—假期的宿舍

    http://www.lydsy.com/JudgeOnline/problem.php?id=1433 (题目链接) 题意 一个暑假,有人去大学里面探望朋友,有些人回家了,有些人留下了,每个人都要在 ...

  10. 【bzoj1082】 SCOI2005—栅栏

    http://www.lydsy.com/JudgeOnline/problem.php?id=1082 (题目链接) 题意 给出m块木柴,以及n块木板,要求将m块木柴做木板,要求将木柴切割成与木板一 ...