Creating Monobjc Applications for the Mac
From The Oxygene Language Wiki
This is a Platform topic
Feel free to add your notes to this topic below.
Monobjc is now officially supported by Prism (3.0.17 and later), but we do not shop project templates yet. Use the following steps to get started using Monobjc:
- Download Monobjc and extract it to a folder of your choice (we recommend C:\Program Files\Monobjc-X.X.X).
- Install the experimental Monobjc project templates from http://remobjects.com/prismextras.
- Create a new project using the Monobjc template.
- If necessary, remove the existing reference to the Monobjc dlls and add new references with the proper paths to the Monobjc assemblies that you downloaded separately.
Converting from Cocoa# to Monobjc
If you have an exiting Cocoa# project you want to convert to Monobjc, the following steps should help:
- Remove the reference to cocoa-sharp.dll and add references to the Monobjc assemblies that you downloaded separately.
- Select the designable.nib file in Solution Explorer.
- Bring up the Property Browser (F4).
- Change the Custom Tool setting from
CocoaSharpNibGeneratorto MonobjcNibGenerator (you'll notice the desigable.pas updates right away).
- Replace all references to
Cocoain all your uses clauses with Monobjc.*. - Replace all references to
Cocoa.Objectin all your code with Monobjc.Cocoa.NSObject. - As last step, you need to manually modify the project file:
- Right-click the project node in Solution Explorer, select Unload <project name>.
- Right-click the grayed-out project node again, select Edit <project name>.
- In the project text, replace the MacPackMode value of
CocoaSharpwith Monobjc. - Save.
- Right-click the project node again, click Reload <project name>.
Your project should now be set for Monobjc. All further development should work similar to how Cocoa# works, except for using different name spaces and slightly different code generated in designable.pas.
Please also check the Migrating from CocoaSharp documentation provided by the Monobjc team.
See Also
Area: Oxygene Platforms
Platform Glossary — Keywords — Types — FAQ — How To