我可以用JavaScript编写iOS(Cocoa)应用程序吗?

问题描述:

PhoneGap为使用HTML5和JavaScript编写跨平台应用程序提供了一个很好的解决方案。

PhoneGap offers a nice solution for writing cross-platform apps with HTML5 and JavaScript.

但我想使用Interface Builder作为UI,控制器代码使用Javascript而不是Objective-C(当然还有混合和匹配的选项,尤其是调用我可能需要的任何Objective-C库)。

But I would like to use Interface Builder for the UI, and just write all the controller code in Javascript instead of Objective-C (with of course the option to mix and match and especially call into any Objective-C libraries that I may need).

有这样的框架吗?类似于CamelBones为Perl所做的事情。

Is there a framework for this? Something akin to what CamelBones does for Perl.

想要这样做的原因是,非UI代码可以理想地用JavaScript编写以便重用于web版本,可能的未来Android PhoneGap版本和服务器端(node.js)。

The reason for wanting to do this is that the non-UI code can ideally be written in JavaScript to be reused for the web version, an possible future Android PhoneGap version, and the server-side (node.js).

您可以尝试使用Appcelerator钛产品。

You could try using Appcelerator's Titanium product. It lets you write native iPhone apps in HTML+Javascript.

查看此处。我没有使用它,但它似乎是你想要的。

Check it out here. I haven't used it, but it seems like what you want.