Objective-C 可以在没有 Cocoa 的情况下使用吗?
看来Cocoa 似乎是Objective-C 的主要平台。 GCC(Xcode 使用的)支持 Objective-C,因此它必须可在广泛的平台上使用。
是否有任何著名的跨平台项目使用 Objective-C 但不使用 Cocoa(或其开源表兄弟 GNUStep)?它真的在苹果生态系统之外使用吗?
It seems that Cocoa seems to be the main platform for Objective-C. GCC (which Xcode uses) supports Objective-C so it must be available on a wide range of platforms.
Are there any notable cross-platform projects that use Objective-C but not Cocoa (or its open source cousin GNUStep)? Is it really used outside the Apple ecosystem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Objective-C 在科学和金融服务界也很受欢迎。银行业中仍然部署了许多基于 Objective-C 的应用程序,主要是在交易分析方面。一位朋友正在研究近百万行基于 Objective-C 的分析和交易引擎代码,他们从头开始编写了自己的类层次结构。
曾经,一种更流行的 Linux 窗口管理器是用 Objective-C 编写的。那是几年前的事了,现在可能不再是这样了。
LLVM 编译器 还编译 Objective-C,包括对 Blocks 的完全支持。它也非常便携。
还有 David Stes 的 便携式对象编译器。它将 Objective-C 编译为 C 并使用直接基于 StepStone 原始 ICPak 类层次结构的类层次结构。
Objective-C has also been popular in the scientific and financial services communities. There are still many Objective-C based applications deployed in banking, mostly on the trading analysis front. A friend works on a nearly million line of code Objective-C based analysis and trading engine for which they have written their own class hierarchy from scratch.
At one point, one of the more popular Linux window managers was written in Objective-C. That was a few years ago and may no longer be the case.
The LLVM compiler also compiles Objective-C, including having full support for Blocks. It is quite portable, too.
There is also David Stes's Portable Object Compiler. It compiles Objective-C to C and uses a class hierarchy that is based quite directly upon the original ICPak class hierarchy from StepStone.
看来您要问的是,Objective-C 是否曾经在没有 Cocoa、GNUstep、Cocotron 或任何类似它们的 API 的情况下使用过。
答案基本上是否定的。如果没有像 Cocoa(或 GNUstep 等)这样的 API,Objective-C 就不是很有用。例如,如果没有 NSObject,
retain
和release
甚至不会存在。这些 API 中内置了大量非常重要的功能,因此如果没有其中一个功能,使用 Obj-C 就毫无意义。It seems what you're asking is if Objective-C is ever used without Cocoa, or GNUstep, or Cocotron, or any API like them.
The answer is basically no. Without an API like Cocoa (or GNUstep, etc.), Objective-C isn't very useful. For example, without NSObject,
retain
andrelease
wouldn't even exist. A ton of very important features are built into these APIs, so it's somewhat pointless to use Obj-C without one of them.是的,肯定有。我从头到尾就能想到的是 Cocotron。将 AppKit 移植到 Windows 的努力。
http://www.cocotron.org/
除此之外,Objective-C 可以在任何平台上使用gcc 将继续运行。您不会拥有 OS X 或 iPhone 上的 Cocoa 中可用的丰富框架,尽管正如您提到的,GNUStep 做了相当好的工作。
Yep, there sure are. The one I can think of from the top of my head is Cocotron. An effort to port AppKit to Windows.
http://www.cocotron.org/
Aside from that, Objective-C can be used on any platform that gcc will run on. You won't have the wealth of frameworks that are available in Cocoa on OS X or the iPhone, although as you mentioned, GNUStep does a pretty good effort.