macos 在 Windows 上为 Mac OS X 开发?

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

Developing for Mac OS X, on Windows?

macosgeneric-programming

提问by Wim ten Brink

Well, simple situation. I happen to be a software engineer who uses mostly Delphi and C# for software development. Delphi is great for desktop applications while C# is ideal combined with ASP.NET for web applications. However, I am considering to teach myself more about software development for the Mac. Xcode and Cocoa would be the environments to start with. Learning new languages is no problem for me!

嗯,简单的情况。我碰巧是一名软件工程师,主要使用 Delphi 和 C# 进行软件开发。Delphi 非常适合桌面应用程序,而 C# 非常适合与 ASP.NET 结合用于 Web 应用程序。但是,我正在考虑自学更多有关 Mac 软件开发的知识。Xcode 和 Cocoa 将是开始的环境。学习新语言对我来说不是问题!

However, before starting to write code on a Mac, I first need to buy one and they're reasonable expensive so buying one is a decision that will take me a few months before I know which one I need. So, to help me right now, I would like to know the possibilities that I have to learn more about Mac development without the need for a Mac!

然而,在开始在 Mac 上编写代码之前,我首先需要购买一个,而且它们的价格相当昂贵,所以购买一个是一个决定,我需要几个月的时间才能知道我需要哪个。所以,现在为了帮助我,我想知道我必须在不需要 Mac 的情况下更多地了解 Mac 开发的可能性!

For example, does OS X work in a VMWare environment? Are the development tools also available for Windows? Is there a clear API overview of the OS X libraries?

例如,OS X 是否在 VMWare 环境中工作?开发工具是否也适用于 Windows?是否有 OS X 库的清晰 API 概述?

Or should I first buy a Mac, play with it for a few weeks and then decide on how to develop software for it? In other words, should I start spending now, or in a few months? :-)

或者我应该先购买一台 Mac,使用它几个星期,然后再决定如何为它开发软件?换句话说,我应该现在开始消费,还是几个月后开始消费?:-)

回答by Mark L

Perhaps a macmini would be the best bet but failing that:

也许 macmini 是最好的选择,但失败了:

MacOSX in VMWare: http://wiki.osx86project.org/wiki/index.php/Vmware_how_to

VMWare 中的 MacOSX:http: //wiki.osx86project.org/wiki/index.php/Vmware_how_to

Development tools for windows? I'd stick to XCode as it can compile multi-binary apps.

windows的开发工具?我会坚持使用 XCode,因为它可以编译多二进制应用程序。

Here's the clearest overview I can think of: http://developer.apple.com/referencelibrary/MacOSX/index.html

这是我能想到的最清晰的概述:http: //developer.apple.com/referencelibrary/MacOSX/index.html

Hope this helps!

希望这可以帮助!

回答by Svetlozar Angelov

Mac OS X works in a VMWare...

Mac OS X 在 VMWare 中工作...

Unfortunately XCode works only on Mac OS...

不幸的是,XCode 仅适用于 Mac OS...

There are versions of Max OS, which runs on x86 machines. You can avoid buying a Mac PC, but you have to pay for the OS and XCode...

Max OS 有多个版本,可在 x86 机器上运行。您可以避免购买 Mac PC,但您必须为 OS 和 XCode 付费...

EDIT:Xcode is free

编辑:Xcode 是免费的

回答by Barry Wark

Good Mac (or iPhone) software is an artisan product; it reflects the culture and tastes of Mac (or iPhone) users. Because the Mac is a premium platform, users tend to be more sensitive to the feel and polish of the apps. Thus to successfully program for the Mac/iPhone or even grok the Cocoa frameworks properly, you have to grok the Mac user experience. Although many coming from the Windows or other-UNIX world try to skip this step, they do so at their own peril.

好的 Mac(或 iPhone)软件是工匠产品;它反映了 Mac(或 iPhone)用户的文化和品味。因为 Mac 是一个高级平台,用户往往对应用程序的感觉和润色更加敏感。因此,要成功地为 Mac/iPhone 编程,甚至正确地了解 Cocoa 框架,您必须了解 Mac 用户体验。尽管来自 Windows 或其他 UNIX 世界的许多人试图跳过这一步,但他们这样做是有风险的。

So, as a Mac developer (who also writes for other UNIX OSes), my recommendation is buy a Mac and start using it, full time if you can. A Mac Mini is completely adequate for development and will set you back only a few hundered dollars, including the OS. Consider that on Windows, this is often less than the price of a full VS license. Everything else (Xcode, libraries, etc.) are free.

因此,作为 Mac 开发人员(也为其他 UNIX 操作系统编写代码),我的建议是购买一台 Mac 并开始使用它,如果可以的话,可以全职使用。Mac Mini 完全适用于开发,并且只需花费数百美元,包括操作系统。考虑到在 Windows 上,这通常低于完整 VS 许可证的价格。其他一切(Xcode、库等)都是免费的。

Once you have a Mac and begin to grok the feel of things, you'll discover that there are a number of development options. Besides the Cocoa frameworks--which can be used from Python (via the built-in PyObjC bridge), Ruby (via MacRuby or RubyCocoa)—-there are a number of other options. Qt from Nokia and Mono are viable. Often cross-platform apps written in Qt or Mono are disliked on the Mac because they don't feel "native" (see above), but really the problem is not the framework. If you get the Mac user experience you can write a very passable Mac app in a cross platform framework. You just have to intend to write a Mac app, not get a Windows app working on the Mac.

一旦您拥有 Mac 并开始熟悉事物的感觉,您就会发现有许多开发选项。除了 Cocoa 框架——可以从 Python(通过内置的 PyObjC 桥)、Ruby(通过 MacRuby 或 RubyCocoa)使用——还有许多其他选择。诺基亚和 Mono 的 Qt 是可行的。通常用 Qt 或 Mono 编写的跨平台应用程序在 Mac 上不受欢迎,因为它们感觉不是“原生”的(见上文),但实际上问题不在于框架。如果您获得 Mac 用户体验,您可以在跨平台框架中编写一个非常通过的 Mac 应用程序。你只需要打算编写一个 Mac 应用程序,而不是让 Windows 应用程序在 Mac 上运行。

回答by Andrew J. Brehm

You definitely want a Mac if you want to develop for the Mac. Even Java requires local testing.

如果您想为 Mac 进行开发,您肯定需要 Mac。甚至 Java 也需要本地测试。

That said, Macs are not very expensive and run Windows too.

也就是说,Mac 不是很贵,也可以运行 Windows。

If you want to learn and start programming before you have a Mac, I recommend either Java or .NET, specifically Delphi Prism.

如果您想在拥有 Mac 之前学习和开始编程,我推荐 Java 或 .NET,特别是 Delphi Prism。

See here my own first experiment with Delphi prism:

在这里看到我自己的德尔福棱镜的第一个实验:

http://leaukiprog.blogspot.com/2009/07/delphi-prism-first-experiment.html

http://leaukiprog.blogspot.com/2009/07/delphi-prism-first-experiment.html

You can write a program for Windows, keep GUI code and other code separate and later replace the Winforms GUI with a native Cocoa GUI on the Mac.

您可以为 Windows 编写程序,将 GUI 代码和其他代码分开,然后在 Mac 上用本机 Cocoa GUI 替换 Winforms GUI。

I found that Pascal is a good language for accessing native APIs from .NET. Everything looks cleaner than with C#, I think.

我发现 Pascal 是一种从 .NET 访问本机 API 的好语言。我认为,一切看起来都比 C# 干净。

The new version of Delphi Prism is coming out on the 25th, as far as I know.

据我所知,Delphi Prism 的新版本将于 25 日发布。

回答by Paul Wicks

You might also look into the GNUstep project. This will let you experience objective-c a little bit before you make the plunge, albeit with the GNU libs instead of cocoa.

您也可以查看 GNUstep 项目。这将让您在尝试之前稍微体验一下 Objective-c,尽管使用的是 GNU 库而不是可可。

回答by Noah

If you code in RealBasic or Lazarus, you can run and compile your apps for both Mac OS and Windows (and Linux in the case of Lazarus). RealBasic isn't that popular outside of the Mac Platform, and isn't free. Lazarus is still a little rough around the edges, but is basically a free version of Delphi.

如果您在 RealBasic 或 Lazarus 中编写代码,则可以在 Mac OS 和 Windows(以及 Lazarus 的情况下为 Linux)运行和编译您的应用程序。RealBasic 在 Mac 平台之外并不流行,而且不是免费的。Lazarus 仍然有点粗糙,但基本上是 Delphi 的免费版本。

Lazarus is working hard on a native COCOA port with the next major version of FPC (though that will probably be available only in 2011)

Lazarus 正在努力开发带有 FPC 的下一个主要版本的本地 COCOA 端口(尽管这可能仅在 2011 年可用)

回答by mcandre

Macs use Objective C. The APIs are very useful and there are many tutorials online. You'll be using Xcode, the Mac equivalent to Windows' Visual Studio and Linux's Glade.

Mac 使用 Objective C。API 非常有用,网上有很多教程。您将使用 Xcode,Mac 相当于 Windows 的 Visual Studio 和 Linux 的 Glade。

I love making cross-platform applications. In a few hours I can prototype an application in Mac and publish it online. Then it'll take a day or two to port to Windows.

我喜欢制作跨平台应用程序。几个小时后,我就可以在 Mac 上制作一个应用程序原型并在线发布。然后需要一两天时间才能移植到 Windows。

回答by mcandre

A Mac looks expensive, but it's not if you look what you get for your money.

Mac 看起来很贵,但如果你看一分钱一分货,那就不是了。

It is entierly up to you if you buy one or not. I guarantee you'll have a lot fun with it, next to programming. If you want a cheap Mac, just buy a Mac Mini for 500 dollars, which you can connect to the Display you already own.

买不买完全取决于你。我保证你会从中获得很多乐趣,除了编程。如果你想要一台便宜的 Mac,只需花 500 美元买一个 Mac Mini,你就可以将它连接到你已经拥有的显示器上。

I recommend doing this on Mac OS X rather than Windows, but again: it's up to you.

我建议在 Mac OS X 而不是 Windows 上执行此操作,但同样:这取决于您。

P.S. You can use VMWare, but I think it's slow if you have less then 4 GB RAM.

PS 您可以使用 VMWare,但我认为如果您的 RAM 少于 4 GB,它会很慢。

回答by djhworld

A Mac really isn't that expensive if you go down the second hand route, I was put off by the price of brand new Macbooks so I got a late 2007 model for £350 and added an extra gig of RAM to it.

如果你走二手路线,Mac 真的没有那么贵,我被全新 Macbook 的价格推迟了,所以我买了一个 2007 年末的型号,价格为 350 英镑,并增加了额外的内存。

Reasonably priced, less hassle for development as well!

价格合理,开发也少麻烦!

回答by Vitor Py

If you want to have just a general feeling about ObjC and the object libraries, why not giving a try to GNUStep?

如果您只想对 ObjC 和对象库有一个大致的了解,为什么不尝试一下 GNUStep?

Take a look at it here:

看看这里:

http://wiki.gnustep.org/index.php/Main_Page

http://wiki.gnustep.org/index.php/Main_Page