views:

364

answers:

3

It seems that Cocoa seems to be the main platform for Objective-C. GCC (which Xcode uses) supports Objective-C so it must be available on a wide range of platforms.

Are there any notable cross-platform projects that use Objective-C but not Cocoa (or its open source cousin GNUStep)? Is it really used outside the Apple ecosystem?

A: 

Yep, there sure are. The one I can think of from the top of my head is Cocotron. An effort to port AppKit to Windows.

http://www.cocotron.org/

Aside from that, Objective-C can be used on any platform that gcc will run on. You won't have the wealth of frameworks that are available in Cocoa on OS X or the iPhone, although as you mentioned, GNUStep does a pretty good effort.

Jasarien
Thanks, that looks interesting! It's still Apple API centric though...
Joe
GNUStep (which includes the wmaker window manager and its own graphic app builder) is definitely anything but Apple API centric - they are derived from the same NeXTStep objectiveC that Cocoa is based on.
Justin Smith
It depends if you believe Steve took the spirit of Apple with him in 1985... :) I meant NeXT and its successors (including Apple).
Joe
+7  A: 

Objective-C has also been popular in the scientific and financial services communities. There are still many Objective-C based applications deployed in banking, mostly on the trading analysis front. A friend works on a nearly million line of code Objective-C based analysis and trading engine for which they have written their own class hierarchy from scratch.

At one point, one of the more popular Linux window managers was written in Objective-C. That was a few years ago and may no longer be the case.

The LLVM compiler also compiles Objective-C, including having full support for Blocks. It is quite portable, too.

There is also David Stes's Portable Object Compiler. It compiles Objective-C to C and uses a class hierarchy that is based quite directly upon the original ICPak class hierarchy from StepStone.

bbum
+2  A: 

It seems what you're asking is if Objective-C is ever used without Cocoa, or GNUstep, or Cocotron, or any API like them.

The answer is basically no. Without an API like Cocoa (or GNUstep, etc.), Objective-C isn't very useful. For example, without NSObject, retain and release wouldn't even exist. A ton of very important features are built into these APIs, so it's somewhat pointless to use Obj-C without one of them.

andyvn22
Ok. That's the answer I was looking for! Thank you. I forgot that the all-important `NSObject` is defined in the API not the language (you would have thought the `NS` would give it away...) FYI the reason I was asking is because I was thinking tidying up a straight C project with some Obj-C and that led me onto the question.
Joe
The Objective-C runtime (the older one on Mac OS X and the GNU runtime) defines an object called `Object` that has many methods in common with `NSObject`, although some have different names. It doesn't contain release/retain but it's enough to start your own framework independent of Cocoa.
dreamlax