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. Activiti 学习笔记(2016-8-30)

    前言 不管学习什么,都必须对知识体系中专有的名词或者特定的语言组织方式 有所了解. 本文仅记录学习过程中的笔记,参考意义因人而定,不保证所言全部正确. 学习方式,百度传课的视频<权威Activi ...

  2. [转]关于网络通信,byte[]和String的转换问题

    最近的项目中要使用到把byte[]类型转换成String字符串然后通过网络发送,但发现发现出去的字符串和获取的字符串虽然是一样的,但当用String的getBytes()的方法得到的byte[]跟原来 ...

  3. 【LintCode】链表求和

    问题分析: 我们通过遍历两个链表拿到每个位的值,两个值加上前一位进位值(0或者1)模10就是该位的值,除以10就是向高位的进位值(0或者1). 由于两个链表可以不一样长,所以要及时判断,一旦为null ...

  4. UML类图中的六种关系及实例【补充】

    ·继承和接口都比较常见,通过继承子类可以直接使用父类的(public,protected属性以及方法:而实现了Speakable接口的Person类必须定义其所有方法,包括speak()): ·依赖指 ...

  5. R语言之RCurl实现文件批量下载

    前言: RCurl工具包的作者是由Duncan Temple Lang现任加州大学 U.C. Davis分校副教授.他曾致力于借助统计整合进行信息技术的探索.使用者通过RCurl可以轻易访问网页,进行 ...

  6. Java中Comparable和Comparator区别小结

    一.Comparable简介 Comparable是排序接口.若一个类实现了Comparable接口,就意味着该类支持排序.实现了Comparable接口的类的对象的列表或数组可以通过Collecti ...

  7. Hp自学整理html

    a:hover {text-decoration:underline; color:#00FF00;}/* 鼠标悬浮在链接上时.出现下划线颜色变绿色 */ display:inline.block.i ...

  8. 【caffe】create_cifar10.sh在windows下解决方案

    @tags caffe python windows下配置caffe后,create_cifar10.sh无法执行,因为是shell脚本.那就看懂脚本意思,用python重写一个: # create_ ...

  9. 使用git管理源代码

    之前用U盘管理自己的demo很不方便.然后发现网上有个git的网站可以管理源代码  这里只是记录简单使用  注:这不是教程 本人之前也是参考这2篇文章http://blog.jobbole.com/7 ...

  10. python图形界面(GUI)设计

    不要问我为什么要用 python 来做这种事,我回到“高兴咋地”也不是不可以,总之好奇有没有好的解决方案.逛了一圈下来,总体上来说,python 图形界面有以下几个可行度比较高的解决方案. 1. py ...