C# and iPhone Development

In 2009, Novell announced and shipped MonoTouch, which allows .NET developers to create native iPhone applications in C#.

What is MonoTouch?

With MonoTouch, applications are compiled into executable code that runs on the iPhone. The significance of this should not be understated: .NET/Mono developers can target the iPhone through MonoTouch.

How does MonoTouch accomplish this? 

MonoTouch provides a .NET layer over the native iPhone programming layer present on the iPhone OS, referred to as Cocoa Touch. Cocoa Touch is based on the Cocoa layer in the Mac OS X and is available on the iPhone, iPod Touch, and the iPad. MonoTouch does not provide a mechanism to cross-compile Windows Forms applications, but allows developers to build applications that run natively on the iPhone.

Overall, the application programming interface (API) exposed by the MonoTouch SDK is a combination of the .NET 2.0 Framework’s core features, the Silverlight 2.0 API, and the APIs on the iPhone.

MonoTouch provides a bridge (interop) between the iPhone’s native APIs based on Objective-C and C-based APIs to the NET world that C# developers are accustomed to.

What are MonoTouch Components?

MonoTouch is made up of the following four components:

1- The Monotouch.dll is a C# assembly that provides a binding API into the iPhone’s native APIs.

2- A command-line tool that compiles C# and Common Intermediate Language (CIL) code. This compiled code can then be run in the simulator or an actual iPhone.

3- An add-in to MonoDevelop that allows for iPhone development and for Interface Builder to create graphical applications.

4- A commercial license of the Mono runtime, which allows for the static linking of the Mono runtime with the code developed.

Copyright © All Rights Reserved - C# Learners