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
- Installing Monobjc into the GAC
- Installing Monobjc Addin for MonoDevelop
- Creating Application
- Debugging Application
Pre-Requisites
In order to follow this tutorial, you need the following:
- Mono 2.6.1
- MonoDevelop 2.2.1
- Monobjc 2.0.492.0
- Apple Developer Tools (XCode)
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:
-
Go to the
Toolsmenu, and selectAdd-in manager. This will open the Addin Manager dialog. -
Click on the
Repositoriesbutton. This will open the Addin Repositories dialog. -
We need to add a new repository to download the addin packages. Click on the
Addbutton to show the New Repository dialog.Enter the following URL for the new repository:
http://codebutler.github.com/monodevelop-monobjc/repo. Then click on theOkbutton to save the repository. -
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.Once the addins selected, click on the
Forwardbutton. -
This screen summarize the addins that will be installed. Click the
Forwardbutton to confirm the installation. -
Once the addin is installed, a confirmation screen is displayed.
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.
Select the Monobjc Application Project. This template contains a very basic application with a controller and an interface builder file.
The project is structured as followed:
Main.cs: Contains the Main method and the bootstrapping of the application.AppDelegate.cs: Contains the application's delegate class. By default, this class contains some methods to show how Monobjc wires some events.MainMenu.xib: This is the main interface builder file of the application.MainMenu.xib.designer.cs: This file is auto-generated by the Monobjc's addin when the interface builder file is changed. It contains all the declared classes as well as their outlets and theirs actions.
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.
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.
With this addin, the debugging of Monobjc's application just get simplier and nicier.









