Search code examples
c#.netobjective-ccocoacode-sharing

What is a good way to maintain common code between C# and Objective-C?


I'm currently in the process of prototyping a few small apps, intended for release on Mac and Windows. Naturally this means Cocoa with Objective-C on the Mac and .NET with C# on Windows. Unfortunately, since these two languages are quite different, working on 4 apps is more like working on 8 since I have to do everything twice.

To some degree this is unavoidable, but I'm exploring ways to share some of the common code/functions that deal with platform independent stuff (calculations, formulas, etc.).

I considered C/C++, but since it needs to be compiled into a DLL for use in C# it doesn't seem worth it.

Now I'm looking at using a scripting language like Lua, which is showing some promise, but it's not without it's share of complications as well. Are there other ways that might be better?


Solution

  • One way is to use Mono, a cross platform open-source development framework.

    http://www.mono-project.com