MonoDevelop Integration

This tutorial will show you how to develop application with the MonoDevelop IDE.

The tutorial is divided into the following steps:

Pre-Requisites

In order to follow this tutorial, you need the following:

Installing Monobjc into the GAC

At the root of the Monobjc's "all in one" archive, you will find a script named GacInstall.sh. This script will install the Monobjc's assemblies into the Mono's GAC, and generate the pkg-config files.

Depending on the tar behavior, you may have to fix the execution permissions before launching the script.

monobjc$ chmod a+x GacInstall.sh

As the script needs to alter the Mono's GAC, you need to execute the script as a sudoer.

monobjc$ sudo ./GacInstall.sh
...
GAC Installer                           
======================================= 

Installing Monobjc 1.0...
=============================
...
 
Installing Monobjc 2.0...
=============================
...

The Monobjc's assemblies are now into the GAC and can be used with the pkg-config tool.

Installing Monobjc Addin for MonoDevelop

Eric Butler has developed a MonoDevelop's addin that ease the development and the debugging of Monobjc's applications.

In order to install this addin, here are steps:

  1. Go to the Tools menu, and select Add-in manager. This will open the Addin Manager dialog.

    Tutorial
  2. Click on the Repositories button. This will open the Addin Repositories dialog.

    Tutorial
  3. We need to add a new repository to download the addin packages. Click on the Add button to show the New Repository dialog.

    Tutorial

    Enter the following URL for the new repository: http://codebutler.github.com/monodevelop-monobjc/repo. Then click on the Ok button to save the repository.

  4. Click on the Install Add-ins... button. This dialog will show all the available addins to install. Select the two Monobjc addins: Monobjc Development and Monobjc Soft Debugger for Monobjc.

    Tutorial

    Once the addins selected, click on the Forward button.

  5. This screen summarize the addins that will be installed. Click the Forward button to confirm the installation.

    Tutorial
  6. Once the addin is installed, a confirmation screen is displayed.

    Tutorial

The addin installation is now over. MonoDevelop is now ready to help you develop and debug Monobjc's application.

Creating Application

The Monobjc's addin contains some templates for a Monobjc's Cocoa application. Go to the File menu and select the New... > New Solution menu. The project template dialog will appear.

Tutorial

Select the Monobjc Application Project. This template contains a very basic application with a controller and an interface builder file.

Tutorial

The project is structured as followed:

With MonoDevelop, you have access to a powerful tool to develop, refactor and organize your code.

Debugging Application

Before debugging the application, let's put some code into the methods. Then put some breakpoints in the code, for example in the ApplicationDidFinishLaunching and the ButtonClicked methods.

Tutorial

Once the breakpoints are set, click on the Run menu, and select Debug to launch the application in Debug mode. The application will then halt on breakpoints. The integrated debugger let you inspect the local variables and their properties.

Tutorial

With this addin, the debugging of Monobjc's application just get simplier and nicier.