objective c - How do you bind to or invoke Foundation functions? -


i'm interested in binding ios foundation functions seen in ios documentation there aren't handles or instances send message invoke them. how monotouch? think involve within monotouch.objcruntime namespace.

all of monotouch's ns* objects implement monotouch.objcruntime.inativeobject interface has property getter called "handle". accessor public on nsobject , subclasses.

edit: code bind nssetuncaughtexceptionhandler() this:

public delegate void nsuncaughtexceptionhandler (intptr exception);  [dllimport ("/system/library/frameworks/foundation.framework/foundation")] extern static void nssetuncaughtexceptionhandler (intptr handler); 

then use this:

static void myuncaughtexceptionhandler (intptr exception) {     // got exception...  }  static void main (string[] args) {     nssetmyuncaughtexceptionhandler (marshal.getfunctionpointerfordelegate(         new nsuncaughtexceptionhandler(             myuncaughtexceptionhandler         )     ); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -