在Windows平台上编写Objective-C的最佳方法是什么?
Cygwin和gcc?有没有办法我可以以某种方式将它集成到Visual Studio?
沿着这条线-关于如何链接和使用Windows SDK来做这样的事情有什么建议吗?这是一个不同的野兽,但我知道我可以在Windows dll中编写汇编和链接,让我可以访问这些调用,但我不知道如何做到这一点,除非谷歌和得到零碎的方向。
有人知道有好的网络或书籍资源来做或解释这些事情吗?
在Windows平台上编写Objective-C的最佳方法是什么?
Cygwin和gcc?有没有办法我可以以某种方式将它集成到Visual Studio?
沿着这条线-关于如何链接和使用Windows SDK来做这样的事情有什么建议吗?这是一个不同的野兽,但我知道我可以在Windows dll中编写汇编和链接,让我可以访问这些调用,但我不知道如何做到这一点,除非谷歌和得到零碎的方向。
有人知道有好的网络或书籍资源来做或解释这些事情吗?
当前回答
另外:
Cocotron是一个开源项目,旨在实现一个类似于苹果公司Cocoa文档所描述的跨平台Objective-C API。这包括AppKit, Foundation, Objective-C运行时和支持api,如CoreGraphics和CoreFoundation。
http://www.cocotron.org/
其他回答
截至2021年,GNUstep Windows MSVC工具链允许在任何Windows应用程序中集成Objective-C代码,包括使用LLVM/Clang的Visual Studio项目。这包括对自动引用计数(ARC)和Objective-C 2.0特性的支持,比如块。
该项目包括来自GNUstep的Foundation、CoreFoundation和libdispatch库。它目前不包括任何UI框架,如AppKit或UIKit,但它可以用来编写特定于windows的UI,使用Objective-C编写的跨平台业务逻辑。
最近一个将Objective C 2.0移植到Windows的尝试是Subjective项目。
自述:
Subjective is an attempt to bring Objective C 2.0 with ARC support to Windows. This project is a fork of objc4-532.2, the Objective C runtime that ships with OS X 10.8.5. The port can be cross-compiled on OS X using llvm-clang combined with the MinGW linker. There are certain limitations many of which are a matter of extra work, while others, such as exceptions and blocks, depend on more serious work in 3rd party projects. The limitations are: • 32-bit only - 64-bit is underway • Static linking only - dynamic linking is underway • No closures/blocks - until libdispatch supports them on Windows • No exceptions - until clang supports them on Windows • No old style GC - until someone cares... • Internals: no vtables, no gdb support, just plain malloc, no preoptimizations - some of these things will be available under the 64-bit build. • Currently a patched clang compiler is required; the patch adds -fobjc-runtime=subj flag
该项目可在Github上使用,在Cocotron Group上也有一个线程概述了一些进展和遇到的问题。
如果您熟悉Visual Studio环境,
小项目:使用gcc的jGRASP 大型项目:Cocotron
我听说有模拟器,但我只能找到Apple II Emulator http://virtualapple.org/。这似乎仅限于游戏。
如果你只是想尝试一下,这里有一个用于。net (Windows)的Objective-C编译器:qckapp
你可以在这里得到一个objective - c编译器,它可以在Windows上工作,并且在Visual Studio 2008\2010上运行良好。
open-c争吵
只需下载最新的源代码。你不需要构建所有的CF-Lite有一个解决方案叫做objc.sln。您将需要修复一些包括路径,但它将构建良好。甚至还包含了一个测试项目,这样你就可以看到一些objective-c .m文件正在visual studio中编译和工作。可悲的是,它只适用于Win32而不是x64。需要为x64编写一些汇编代码来支持它。