Understanding Monotouch under the hood?

I read a lot about how MT works, that it communicates with the iOS API, that it uses AOT compilation, that the iPhone does not have a .NET runtime, etc.

Jeff once wrote this in response to one of my questions, which shows how to bind an ObjC selector:

var url = new NSUrl ("http://www.google.com/");
var str = (NSString) Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend_IntPtr (Class.GetHandle ("NSString"), Selector.GetHandle ("stringWithContentsOfURL:"), url.Handle));

But what happens under the hood if I do this? And does that mean if I use a call that is already connected, it will do something similar, like in the above code in the background, hiding it from me? Does this mean that every time some Selector.GetHandle () and Runtime.GetNSObject () commands are executed?

How was the entire MT project launched? At some point, the team must have thought: "We have ObjC and Mono here - how can we combine them?" I mean, what was the first thing that was done, tried?

And the last thing that happens with the garbage collector: I assume that it should run in a separate thread, but is it really ONE thred? Or are there several of them? How does the GC collector decide it's time to clean?

+5
source share
1 answer

Alot of what MonoTouch does is exactly what Mono does on other operating systems.

They started with a subset of .Net BCL: Silverlight, and also bundled apis Objective-C on the iPhone. They probably also created the AOT compilation option, as I assume this is the first situation that needs it. Apple demanded (or strongly preferred) that no one would abstract, or put a layer on top of their APIs. So far, MonoTouch is the only infrastructure that has successfully done this to bring a new iPhone language.

, . MonoTouch, Documentation, .

, , stackoverflow, IRC. - -, IRC.

+2

All Articles