Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A while back I tried learning Objective-C on Linux. My end goal was to do iOS development, but I wanted to try it out before I spent the money on a Mac. Maybe I'd hate Obj-C and know immediately it wasn't for me...

Using the Objective-C language on Debian was as easy as doing "apt-get install gobjc". But, as you stated, most of the utility comes from Cocoa.

Even though it's technically possible to use Objective-C without Cocoa, in practice it's almost not worth it. It's not like C++ where you can chose between Qt and Gtk+ or some other big library. There's Cocoa/Foundation or there's nothing. It would be hard to find learning material that didn't use Cocoa, even if you wanted to try it.

There are a few alternative Cocoa implementations that run on Linux and even Windows.

Cocotron lets you create Windows apps using Cocoa, but it's a cross-compiler that runs in XCode. Didn't fit my needs, so I didn't try it.

libNuFound was pretty good for the Foundation part of Cocoa, but it took a bit of work to make it work. Objective-C with only Foundation has a lot more functionality than plain Objective-C, but still no where near the usefulness of Cocoa.

The most complete and most popular option is GNUStep. It implements Foundation and a good chunk of Cocoa. They've done good work, but the documentation was lacking, and I never knew whether code I saw on the web and in Cocoa tutorials would work under GNUStep, without trying it. Apple's developer documentation is really good, and I used it as much as possible, but it was pretty common to run into stuff that didn't work under GNUStep. My other big complaint was that it's a really heavy weight "library." I don't know if it's their fault, but I vaguely remember having to install a bunch of seemingly unrelated dependencies just to get their *-dev packages installed on Debian.

Perhaps not the best comparison, but for me, using GNUStep libraries to develop Cocoa always felt like using Wine to run Windows programs.

I had a few other links about setting everything up, but these two were helpful:

http://blog.vucica.net/2010/12/getting-objective-c-2-0-to-wo...

http://orangejuiceliberationfront.com/playing-with-objective...

FWIW, I did eventually buy a Mac, and can say Objective-C and Cocoa on iMac is much easier on OSX than Debian.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: