是否可以在 Windows 中执行 Objective-C 程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1903869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:35:27  来源:igfitidea点击:

Is it possible to execute Objective-C programs in Windows?

objective-cwindows

提问by Mohit Jain

I googled a lot. Some people are saying do this. Some are saying it's not possible. Install Mac OS X on a virtual machine, etc., etc.

我用谷歌搜索了很多。有些人说这样做。有人说这是不可能的。在虚拟机上安装 Mac OS X,等等。

I have a simple question. Is it possible that I can practice Objective-Cprogramming on a Windows 7 machine?

我有一个简单的问题。 我可以在 Windows 7 机器上练习Objective-C编程吗?

If yes, how? Please, if possible, provide me with a necessary link. My ultimate goal is to go for iPhonedevelopment. But right now I can't afford a MacBook.

如果是,如何?如果可能,请为我提供必要的链接。我的最终目标是进行iPhone开发。但是现在我买不起MacBook

So is it possible?

那么有可能吗?

回答by Javier

Objective-C, the language, definitely yes. At the very least, GCC (GNU Compiler Collection) compiles Objective-C just fine. You can get either Cygwin for the full POSIX-like environment, or MinGW which gives just the GNU toolchain for programming to the Win23 API

Objective-C,语言,绝对是的。至少,GCC(GNU Compiler Collection)可以很好地编译 Objective-C。您可以获得用于完整 POSIX 类环境的 Cygwin,或仅提供用于对 Win23 API 进行编程的 GNU 工具链的 MinGW

But, iPhone needs the Apple API, which is totally proprietary; if they say 'No Windows', then it's just not available for Windows

但是,iPhone 需要 Apple API,这是完全专有的;如果他们说“没有 Windows”,那么它只是不适用于 Windows

Of course the iPhone API is based on Cocoa, which is based on NextSTEP. You can get the feel of the API with OpenSTEP.

当然iPhone API是基于Cocoa的,而Cocoa是基于NextSTEP的。您可以通过 OpenSTEP 体验 API。

But it's not iPhone.

但这不是 iPhone。

回答by Felix Kling

Yes you can compile Objective-C on Windows. But for iPhone development this question was already asked.

是的,您可以在 Windows 上编译 Objective-C。但是对于 iPhone 开发,这个问题已经被问到了

And there are several similar questions about iPhone development here on Stackoverflow, just search for it.

而且 Stackoverflow 上有几个关于 iPhone 开发的类似问题,搜索一下就可以了。

回答by Jim Dovey

It's worth taking a look at Cocotron— that aims to implement a cross-platform Apple-compatible version of the core NeXTStep libraries, the FoundationKit and ApplicationKit. Windows included.

Cocotron 值得一看——它旨在实现核心 NeXTStep 库、FoundationKit 和 ApplicationKit 的跨平台 Apple 兼容版本。包括窗户。

回答by Felixyz

The answer is yes, but it will probably require quite a lot of work on your part:

答案是肯定的,但这可能需要您做很多工作:

www.gnustep.org www.cocotron.org

www.gnustep.org www.cocotron.org

回答by Anon.

GCC (http://gcc.gnu.org/) can compile Objective-C.

GCC ( http://gcc.gnu.org/) 可以编译 Objective-C。

回答by Martin Berger

This page on StackOverflow, answer 4. It worked great in my case.

StackOverflow 上的这个页面,回答 4。它在我的情况下效果很好。

Objective C for Windows

适用于 Windows 的目标 C