如何将Cocoa/Mac应用程序移植到Windows? [英] How do you port a Cocoa/Mac application to Windows?
问题描述
如何将Cocoa/Mac应用程序移植到Windows?我的意思是你会怎么做?假设该应用程序是用Objective-C和Cocoa编写的,没有任何花哨的事情,没有可以被排除的引擎",等等.
How do you port a Cocoa/Mac application to Windows? I mean how would you go about it? Assume the app was written with Objective-C and Cocoa, there's nothing fancy going on, no "engine" that could be factored out, etc.
从头开始重写?我认为Mac和Windows代码库之间不会有巨大的重叠,对吗?
Rewrite from scratch? I don't think there will be huge overlaps between the Mac and Windows codebases, right?
推荐答案
Objective C的问题在于它在非OS X的任何平台上的支持都很差.您可以尝试使用
The problem with Objective C is its very poor support on any platform that is not OS X. You can attempt to use the Cocotron, but I wouldn't consider it production ready yet.
为了便于携带,请重新编写命令.通过明智地将标准C或C ++用于应用程序的核心",您仍然可以实现平台特定的GUI代码.如果您不喜欢维护两个GUI,也可以尝试使用工具包,例如 Qt
For portability, a re-write is in order. With judicious use of standard C or C++ for the "core" of the application, you could still implement platform specific GUI code. If you don't like maintaining two GUIs, you can also try a toolkit such as Qt
这篇关于如何将Cocoa/Mac应用程序移植到Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!