views:

346

answers:

8

The current standard way of developing Mac OS X apps is with XCode/Objective-C/Interface Builder using the MVC paradigm.

Is there an alternative?

I'd like to use Interface Builder (XCode too) however I would rather use a different programming language. I come from .NET programming where you can delegate a click to a certain function, etc.. Is there something like that for Mac? I would rather stay away from bootstrapped apps like Titanium or Qt or RealBASIC.

A: 

Check out the mono project http://www.mono-project.com/Main_Page

wgpubs
+2  A: 

Depending on your language experience, and target requirements you might find MacRuby very interesting.

There is also PyObjC and a older ruby bridge named RubyCocoa.

However, if you're looking for iphone development, the only thing I've heard about is MonoTouch from Novell, and requires licensing fees.

Please note that all of the above techs allow pretty seamless integration with both their native language libraries as well as the libraries and frameworks found in Cocoa and Carbon.

Using these techs will give you a fairly clean native feeling app. However, many if not all will still require you to use Interface Builder. Which I know took me a while to get used to too.

Bryan McLemore
+6  A: 

Objective-c is very powerful and together with Cocoa and Interface Builder allow you to develop UI on Mac OS X.

You can associate target in UI with action in code that gets executed and so on.

You can check out IB guide, connections and bindings and Introduction to Cocoa Application Tutorial which builds example application (check out the Bridging the Model and View: The Controller section for how UI elements get hooked up to code) - that is if you are interested in Objective-c/Cocoa.

stefanB
A: 

There are lots of bridges. PyObjC, CamelBones (Perl), JSCocoa (JavaScript), Cocoa#, HOC (Haskell), etc. The only one that's really even close to seamless is MacRuby, a Ruby implementation on top of core Mac OS X technologies like LLVM and the Objective-C runtime and garbage collector that's designed to be a peer language to Objective-C for Cocoa development. It's still in beta, though. It does let you assign a Ruby block as the action handler for UI elements, which I gather is something you like doing.

Chuck
+4  A: 

You can already assign clicks to methods in Objective-C - you define a method with a return type of IBAction and you can wire that to a number of possible events in a button, or many other controls for that matter.

Learn to use the tools before you decide to wander off to other languages, because there is a lot of depth here from decades of evolution.

Kendall Helmstetter Gelner
While i agree that IB and XCode present a powerful development platform and the cocoa libraries are awesome in many ways. They also have a lot of short comings. Especially if you come from a platform like C# or many other languages that have features you come to take for granted. Closures, native regex support, and web services integration are among some of the things that many languages have built in and are very robust, but obj-c/cocoa just doesn't have the support there for them.
Bryan McLemore
Cocoa does have closures with the 10.6 API, they're called blocks and many of the existing APIs have new methods which accept blocks as arguments. If you want RegEx, go here: http://regexkit.sourceforge.net/
Rob Keniger
maybe some of them are available via frameworks/external frameworks, or as c/c++ libraries or are just not needed by anyone?
stefanB
RegEx support is built into the platform, it's just not well exposed - that's what the RegExKit hooks into. If Cocoa is not providing you some functionality look at the CF level frameworks.I have used many other languages (including a bit of C# development) and I repeat the statement there is a lot more going on with Objective-C and the frameworks than most people realize. Every item you listed is covered in the Mac frameworks, to a degree some are less covered on the iPhone but you can still make easy use of all of them. And the OS X platform has things like Core Data/Core Animation.
Kendall Helmstetter Gelner
A: 

It's hard to say whether you prefer elaboration on language or design patterns.

See Objective-C++, Python, or Ruby (the java bridge is deprecated). Remember that ObjC is a superset of C, you can use C, C++ and ObjC in the same app/sources. Soo... you may be most comfortable using Objective-C++. It sounds like a hybrid object, but it is merely support for the objects and syntaxes in the same program (i.e. you do not base a ObjC class on a C++ class, but you can use members). This is a big topic, actually, though I've never seen writings on it beyond a few pages.

As far as design patterns, well, you're the programmer :)

Justin
A: 

Your best bet, would be to use Cocoa Sharp support for winforms. There are some tutorials on the cocoasharp site. That would give you a head start, but I'm afraid you won't get very far with this approach, Cocoa is not really suited to that approach and in the end, code would end up difficult to manage.

What you can do, if you don't mind the Cocoa conventions but are not really into Objective-C, is to use Cocoa Sharp (i.e, C#) to code using Cocoa's MVC paradigm. That way, you still get to use Interface Builder (I'm not so sure of XCode support in Snow Leopard) and use a familiar language.

Looks like this approach is productive, as people are even doing iPhone applications that way.

Victor Jalencas
+4  A: 

There are so many of these questions on SO. Especially in the mac/iphone tags. Someone posts asking how to make mac/iphone development more like some IDE/paradigm they already know.

Mac development is different from C#, .NET, etc. It is not less powerful, it's just different. Cocoa has many strengths which might not be apparent when you are trying to apply your old way of thinking.

Not to diss any of projects mentioned here (PyObjC, MacRuby, etc.) but they are going to be just as confusing, because they are a thin (and leaky) abstraction layer over the native developer tools.

If you're going to develop on the Mac, take some time and learn Objective-C/Cocoa/Xcode/IB. It's not the way you know, but it's a good way if you give it a chance. Once you know it you will have criticisms still, but you will also have undoubtedly found things you really like about it.

If you don't like to learn new platforms/paradigms/environments learn java or qt once and be done with it.

Kenny Winker