objective-c 为什么没有适用于 Windows 的 Xcode?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2065343/
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-03 22:46:12  来源:igfitidea点击:

Why isn't there Xcode for Windows?

objective-cxcodemacos

提问by Ryan

Why can't Xcode be hacked to be able to run on Windows? Does Xcode have another programming methods?

为什么不能破解 Xcode 使其能够在 Windows 上运行?Xcode 还有其他编程方法吗?

Also, I heard that iPhone apps are made with Objective-C, so why is this not available in Windows?

另外,我听说 iPhone 应用程序是用 Objective-C 制作的,为什么这在 Windows 中不可用?

Thanks

谢谢

回答by mipadi

Xcode is written in Objective-C and takes advantage of a number of OS X frameworks, so porting it to Windows would require porting all the frameworks on which Xcode relies. Furthermore, Xcode also uses a number of programming tools that would have to be ported to Windows as well (some of them already are, of course).

Xcode 是用 Objective-C 编写的,并利用了许多 OS X 框架,因此将其移植到 Windows 需要移植 Xcode 所依赖的所有框架。此外,Xcode 还使用了许多必须移植到 Windows 的编程工具(当然,其中一些已经移植了)。

There are several reasons that Objective-C isn't readily available on Windows:

Objective-C 在 Windows 上不可用的原因有几个:

  1. Most development of Objective-C frameworks takes place on OS X, and a lot of the frameworks aren't open-source and thus can't be ported to Windows (they'd have to be rewritten).
  2. There are some open-source frameworks that could be used on Windows -- for example, OS X's AppKit and Foundation frameworks are (mostly) available as part of the GNUstep project -- but these frameworks aren't widely used or supported on Windows, and sometimes lack capabilities found in their OS X counterparts.
  1. 大多数 Objective-C 框架的开发都在 OS X 上进行,而且很多框架不是开源的,因此不能移植到 Windows(它们必须被重写)。
  2. 有一些开源框架可以在 Windows 上使用——例如,OS X 的 AppKit 和 Foundation 框架(大部分)作为 GNUstep 项目的一部分可用——但是这些框架在 Windows 上没有被广泛使用或支持,有时缺乏 OS X 中的功能。

That said, GCC isavailable on Windows, and since GCC is an Objective-C compiler, you couldcompile Objective-C code on Windows ifyou had the right libraries available (or didn't use any third-party libraries). But Objective-C isn't terribly useful without supporting frameworks, and those are rare or nonexistent on Windows.

也就是说,GCC在 Windows可用,并且由于 GCC 是一个 Objective-C 编译器,如果您有合适的可用库(或不使用任何第三方库),您可以在 Windows 上编译 Objective-C 代码。但是,如果没有支持框架,Objective-C 并不是非常有用,而这些框架在 Windows 上很少见或不存在。

回答by Yada

Same can be said why isn't there Visual Studio 2008 for OSX.

同样可以说为什么没有适用于 OSX 的 Visual Studio 2008。

回答by dmckee --- ex-moderator kitten

Xcode is a big application written to set of APIs not present on Windows. Porting it would be an enormous job, maintaining it would be a big job, and there are already popular IDEs on the Windows platform.

Xcode 是一个大型应用程序,用于编写 Windows 上不存在的一组 API。移植它是一项艰巨的工作,维护它是一项艰巨的工作,而且 Windows 平台上已经有流行的 IDE。

回答by Martin Marconcini

I guess that porting XCode would be close to very hard (if not impossible) but even if you were able to have a running XCode version under Windows, I guess that it won't do what you really want it to do. I assume you want a complete iPhone SDK environment which is reliant on XCode and Interface Builder in a very tight way. That'd require the port of Cocoa Frameworks (among other things) that would be, now for real, impossible to port.

我想移植 XCode 将非常困难(如果不是不可能的话),但即使您能够在 Windows 下运行 XCode 版本,我想它也不会做您真正想要它做的事情。我假设您想要一个完整的 iPhone SDK 环境,它以非常紧密的方式依赖于 XCode 和 Interface Builder。这将需要 Cocoa Frameworks 的移植(除其他外),现在实际上是不可能移植的。

Truth is, as much as you will surely need Windows for Windows Phone development, you need a Macintosh computer for iPhone development.

事实是,尽管您肯定需要 Windows 来进行 Windows Phone 开发,但您需要一台 Macintosh 计算机来进行 iPhone 开发。

On the other hand, Xcode as an IDE, is not the best in the world, so even if you managed to get Xcode and make it use, .NET (for example), I'd much rather use visual studio for that.

另一方面,Xcode 作为 IDE,并不是世界上最好的,所以即使你设法获得 Xcode 并使用它,.NET(例如),我更愿意使用 Visual Studio。

回答by Icestreaker

Actually you can install Mac OS X on any Intel CPU based machine. It is legal as you own the orginal install DVD for the OS X system. After aquiring a copy of Virtualbox or VMWare (either is great, personally I prefer Virtualbox because the display settings are more customizable). Virtualbox allows setup on initial setup while VMWare requires an extra step to ensure compatibility. You can then find the steps online to setup a virtual copy of MacOS X.

实际上,您可以在任何基于 Intel CPU 的机器上安装 Mac OS X。因为您拥有 OS X 系统的原始安装 DVD,所以这是合法的。在获得 Virtualbox 或 VMWare 的副本后(两者都很棒,我个人更喜欢 Virtualbox,因为显示设置更可定制)。Virtualbox 允许在初始设置时进行设置,而 VMWare 需要额外的步骤来确保兼容性。然后,您可以在网上找到设置 MacOS X 虚拟副本的步骤。

After going through the steps to install the OS in the Virtual Machine, you can then go through the process to find XCode in the Apple App Store. From there, have at it. Start programming in XCode and have a good time. Since XCode has its own device emulator you have a built in platform for iOS testing. There may be times where it is a bit buggy but that is to be expected with ANY emulator for ANY system you run.

在完成在虚拟机中安装操作系统的步骤后,您可以完成在 Apple App Store 中找到 XCode 的过程。从那里开始吧。开始在 XCode 中编程并享受美好时光。因为 XCode 有自己的设备模拟器,所以你有一个内置的 iOS 测试平台。有时它可能有点问题,但是对于您运行的任何系统的任何模拟器都是可以预期的。

After you get everything installed and going, sit back and enjoy the programming ride. The only catch is if you want to post anything on the Apple App store and then you will have to deal with getting an Apple Dev License. Objective C can be a bit difficult at times but, at the same time, it can be very satisfying when you solve those programming problems (as with any programming language right ;-) )

安装好所有东西后,坐下来享受编程之旅。唯一的问题是,如果您想在 Apple App Store 上发布任何内容,那么您将不得不处理获得 Apple Dev License。Objective C 有时可能有点困难,但同时,当您解决这些编程问题时,它会非常令人满意(就像使用任何编程语言一样 ;-))

Enjoy

享受

PS... this VM install keeps up with all updates from the Apple App Store so keeping the system updated won't be a problem.

PS...这个VM安装跟上来自Apple App Store的所有更新,所以保持系统更新不会有问题。

PSS... I will not condone anyone for where their source of software is but do keep in mind, setting up a VM with VMWare or Virtualbox and an install DVD is only legal IF you personally OWN the install DVD you created the install image from yourself!

PSS ...我不会宽恕任何人的软件来源,但请记住,使用VMWare或Virtualbox设置VM和安装DVD仅在您个人拥有创建安装映像的安装DVD时才合法你自己!

回答by sdornan

The same reason you can't install Mac OS X on your PC: Apple chooses to make it available only to people who own their own brand of computers.

与您无法在 PC 上安装 Mac OS X 的原因相同:Apple 选择仅将其提供给拥有自己品牌电脑的用户。