Is it possible to code Objective-C on Windows? - objective-c

I would like to test Objective-C, but I don't have a Mac. Is it possible to program Objective-C in Windows? Another possibility is to do it in Linux. Does anyone know if either is possible?

Yes, the GNU Compiler Collection contains an Objective-C frontend.
It will easily work on Linux and can be used on Windows too if you workaround with some binary distributions like cygwin or gnustep.
But I don't think you will have any kind of Cocoa API, you will have just the ObjC syntax.

Related

Using objective-c in linux

I try to use objective-c in linux.
Which version of iOS is "supported" when using compilers like gobjc++, gobjc, libgnustep-base-dev
None. I don't know of any non-Apple tool chain that can be used to compile Objective-C for iOS devices. For a start, you at least need an ARM cross compiler.

Using a cocoa command line application in Linux

I'm writing a command line tool in Objective-C (within xCode) that uses the Foundation Framework. I have to use Objective-C because I need to unarchive objects previously archived by NSKeyedArchiver.
My question is, I'm wondering if I can now use this compiled application on my Linux web server.
I'm not sure if there would be a runtime issue or if the executable could be its own standalone program that could actually run on my Linux server.
I'd appreciate any feedback.
You can use The Cocotron to build your app targeted to Linux. It is an actual Cocoa implementation meant to fully interoperate (although it's not 100% complete of course), as opposed to GNUstep which is not meant to work that way. I use this and it is awesome.
No, you cannot run a program that was compiled on and for a Mac on a Linux system. So you will have to compile it for (and on) Linux. Apple's Foundation framework is not available for Linux, but have a look at GNUstep, a free and open Cocoa implementation.
I don't know if GNUstep can read archives that have been archived with Cocoa's NSKeyedArchiver, though.
I have provided a wrap-up on how to compile a command line tool based on the Cocotron Foundation framework on my blog.
This does also include a step by step guide on how to cross compile the Foundation framework for Ubuntu Linux.
Hope this is helpful!

Objective C on Windows or Linux

I would like to learn objective-c, but don't have a Mac.
How would I compile obj-c on Windows or Linux?
I would prefer Windows, but Linux would be OK.
GCC has an objective-C compiler. You may also want to investigate the GNUStep tools, which provide a clone of the OpenStep APIs (Which Cocoa is based on.)
You can use gcc to compile objective c as suggested by the previous answers. But one thing is if you are planning this for iPhone development then mac is a must as the framework, simulator etc. are not available in other platforms.
http://gnustep.org/ -- no experience using it, but it might be worth a shot.
If you just want to experiment, there's an Objective-C compiler for .NET (Windows) here: http://www.qckapp.com/index.html?p=ObjC

Is it possible to use Cocoa classes in an app that runs on Linux

I am need to parse a pdf file. I would like to use objective-c and Cocoa classes to do so, but I need the resulting application to run on Linux. Is this possible? My experience to Objective-C revolves around the iPhone so I'm relatively new to Cocoa. Thanks.
Cocoa is Mac and iPhone only, but you could use GNUstep, which is based off the same OpenStep Objective-C API as Cocoa, and PopplerKit for PDF reading.
In addition to GNUstep, there's Cocotron which cross-compiles from Xcode running on a Mac. If you can develop on Xcode, then it's an option.
No, Cocoa is specific to Mac. You can use Objective C on Linux, but I doubt there's much library support. You might have better luck finding a PDF parser for Linux (ghostscript might have libraries) that also works on Mac.

Is there a Mac emulator or Objective-C environment I can run on Windows?

I'm in the process of learning Objective-c but would like to run code snippets via some sort of emulator on Windows — preferably web based.
I want to understand Objective-C syntax and walk through common code examples, probably via some sort of console. I would probably leave any framework type learning for when I get onto my MacBook, at home.
I have done a quick Google with no success.
It depends what you mean. Objective-C can be compiled by GCC, so you can happily create Objective-C test apps on Windows. If you are talking about the frameworks though, which contain most of the power when developing on OSX then it's a no unfortunately. You can get libraries compatible with SOME parts from gnustep.org (and run them on Linux/BSD), but it's still not the full OSX "stack".
You can get OS X running in VMWare, but it's illegal, so you best bet is to pickup a cheap Mac that can run Tiger/Leopard and use that.
Looked at GNUStep?
Another possibility is to use Cappuccino.
http://cappuccino.org
It is a cocoa-like framework for javascript, and looks very similar to objective-c.
The language is called objective-j.
AFAIK you can use the GNU compiler to compile Objective-C, so that should be usable on Windows too. This should be sufficient to get you started with programming the language.
For Mac OS X however the language is only part of the equation, you will want to program against the libraries of Mac OS X, and for that you will really need a machine running it.
I'm not sure which libraries are present and which are not but you can run OS X Server in a VM (providing you have an OS X Server license of course). This would allow you to have a virtual Mac environment on your Windows system.
As has been mentioned above, there's no way to achieve what you want natively within Windows as the underlying system is obviously different.
Good luck.
There also is The Cocotron.