Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective C <-> Mono bridge

I'm considering writing a cross-platform desktop app, initially for Mac/Windows, but eventually for Linux as well.

Currently, I plan to structure it like so:

  • Mac UI using Cocoa/Objective C/Interface Builder
  • Windows UI using WPF
  • In future, Linux UI using GTK#
  • Business/data access layers in C# - i.e. .NET on Windows, Mono on Mac/Linux

This will obviously be fine on Windows, I'm pretty sure it'll be fine on Linux/Gnome based on the GTK# apps I've seen. Calling into Mono on the Mac, however... I figure I've got these options:

  • ObjC#
  • Dumbarton (looks kinda dead)
  • Monobjc (this would mean writing the Mac UI in C# instead of Objective C - not so keen on this)

My question: has anyone had any experience building apps in a similar fashion? Any recommendations? Am I insane?

FYI - I'm pretty fussy about desktop UIs being "at one" with their host operating systems, so I'm not interested in clunky WinForms/Java/QT solutions...

like image 402
Mark Beaton Avatar asked Oct 29 '09 09:10

Mark Beaton


2 Answers

If anyone stumbles on this...

MonoMac looks like it will be the obvious way forward.

like image 101
Mark Beaton Avatar answered Oct 15 '22 07:10

Mark Beaton


For what it’s worth, I’m coming from the Mac side here., but I think my comments are universally applicable.

Given your stated desire to write applications with platform-specific UI, I think ObjC# is the only reasonable choice. There are oodles of resources on implementing Mac-side UIs in Objective-C; I think it’d be a waste of your time to try to translate all the advice you find to Monobjc, especially when you run into an API that wants you to twiddle some pointers and pass a function handle and oh no what do you do now. The only thing you can share between apps is model code; I postulate that there’s no reason to try to keep things in the same language on the presentation side unless you think you can’t or won’t be able to familiarize yourself with Objective-C.

like image 28
Ben Stiglitz Avatar answered Oct 15 '22 07:10

Ben Stiglitz