Mac上有Objective-C解释器吗? [英] Is there an Objective-C Interpreter for the Mac?

查看:107
本文介绍了Mac上有Objective-C解释器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候打开一个解释器,键入一些代码并查看它是否正常工作,而不是为了快速测试某些东西而不得不编译诸如Xcode项目之类的大东西,这是很好的选择. Mac上是否存在Objective-C解释器,还是我不走运?

Sometimes it's nice to open an interpreter, type out some code and see if it's working, rather than having to compile something large like an Xcode project just to quickly test something. Does an Objective-C Interpreter exist for the Mac, or am I out of luck?

更新:App Store中有一个名为 CodeRunner的付费程序 ,可让您快速运行Obj-C(以及其他几种语言).它不是解释器,但是可以很好地用于快速测试想法: http: //itunes.apple.com/us/app/coderunner/id433335799?mt=12

UPDATE: There's a paid program in the App Store called CodeRunner, which lets you run Obj-C quickly (and several other languages). It's not an interpreter, but works pretty well for testing out ideas quickly: http://itunes.apple.com/us/app/coderunner/id433335799?mt=12

推荐答案

您可以使用 F脚本,这是基于Smalltalk的,但是可以让您与Cocoa交互.您也可以将其嵌入应用程序中,以便在运行时检查视图和其他内容.这很有用.正如评论中指出的那样,还有其他可用的语言桥梁,例如 PyObjC RubyCocoa / MacRuby Nu 等.

You can use F-Script, which is Smalltalk-based, but lets you interface with Cocoa. You can also embed it in your application, to let you inspect views and other things at runtime. It's quite useful. as pointed out in the comments, there are other great language bridges available, like PyObjC, RubyCocoa/MacRuby, Nu, etc. CINT is an example of a C interpreter, but not Obj-C.

对于实际的Objective-C解释器,我认为没有一个真正的解释器.但是用Xcode设置命令行工具"项目并不难,它为您提供了一个非常简单的main.m文件来尝试使用.

As for an actual Objective-C interpreter, I don't think one really exists. But it's not too hard to set up a "Command Line Tool" project in Xcode, which gives you a really simple main.m file to try something in.

这篇关于Mac上有Objective-C解释器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆