可以使用哪些编程语言来开发 iPhone、iPod Touch 和 iPad (iOS) 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3949995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 17:55:46  来源:igfitidea点击:

What programming languages can one use to develop iPhone, iPod Touch and iPad (iOS) applications?

iphoneipadios4ios

提问by

What programming languages can one use to develop iPhone, iPod Touch and iPad (iOS) applications?

可以使用哪些编程语言来开发 iPhone、iPod Touch 和 iPad (iOS) 应用程序?

Also are there plans in the future to expand the amount of programming languages that iOS will support?

未来是否有计划扩大 iOS 支持的编程语言数量?

采纳答案by Lou Franco

Apple lifted the restrictions on non-Objective C/C/C++ apps -- you just can't load code that isn't in the app bundle.

Apple 取消了对非目标 C/C/C++ 应用程序的限制——你只是无法加载应用程序包中没有的代码。

MonoTouch lets you use .NET languages -- C# is directly supported, but if you have Windows, you can make assemblies in any .NET language and use it.

MonoTouch 允许您使用 .NET 语言——直接支持 C#,但如果您有 Windows,则可以使用任何 .NET 语言制作程序集并使用它。

There are rumors that Apple is going to support other languages directly -- I keep hearing ruby, but they are just rumors.

有传言说 Apple 将直接支持其他语言——我一直听到 ruby​​,但它们只是传言。

I think Lua is being used for game logic on a lot of apps.

我认为 Lua 被用于许多应用程序的游戏逻辑。

EDIT (in 2018): Generally you can use any language that you can get to compile for iOS or even install language interpreters. The main thing you cannot do is load code from the Internet that wasn't in the app bundle.

编辑(2018 年):通常,您可以使用任何可以为 iOS 编译的语言,甚至可以安装语言解释器。你不能这样做的主要事情是从网上得知是不是在应用程序包中加载代码。

People do this all of the time anyway (see React Native apps loading JavaScript from servers), but, technically, it's not allowed. The main thing that will get you attention from Apple if you make some kind of App Store that loads whole App-like things.

无论如何,人们总是这样做(请参阅 React Native 应用程序从服务器加载 JavaScript),但从技术上讲,这是不允许的。如果您制作某种可以加载整个 App 之类的东西的 App Store,那么主要会引起 Apple 的注意。

EDIT (in 2020): from @Pylot in comments: I know this is a long time ago, but now at least technically you can load code that isn't embedded in the app, as you can write with JavaScript using the webview. Not staying your answer is wrong or anything, I definitely agree with you. but I was looking for something and found this post on the way. Figured if anyone sees this it might help them out.

编辑(2020 年):来自@Pylot 的评论:我知道这是很久以前的事了,但现在至少从技术上讲,您可以加载未嵌入应用程序的代码,就像您可以使用 webview 使用 JavaScript 编写一样。不留下你的答案是错误的或任何事情,我绝对同意你的看法。但我正在寻找一些东西,并在途中找到了这篇文章。想如果有人看到这可能会帮助他们。

回答by hotpaw2

The SDK agreement and App store guidelines have been changed (circa Sept 2010).

SDK 协议和应用商店指南已更改(大约 2010 年 9 月)。

You can now probably use any compiled language that will compile to the same static ARM object file format as Xcode produces and that will link to (only) the public API's within Apple's frameworks and libraries. However, you can not use a JIT compiled language unless you pre-compile all object code before submission to Apple for review.

您现在可能可以使用任何编译语言,这些语言将编译为与 Xcode 生成的相同的静态 ARM 对象文件格式,并且将链接到(仅)Apple 框架和库中的公共 API。但是,您不能使用 JIT 编译语言,除非您在提交给 Apple 之前预编译所有目标代码。

You can use any interpreted language, as long as you embed the interpreter, and do not allow the interpreter or the app to download and run any interpretable code other than code built into the app bundle before submission to Apple for review, or source code typed-in by the user.

您可以使用任何解释性语言,只要您嵌入了解释器,并且在提交给 Apple 或输入源代码之前,不允许解释器或应用程序下载和运行除内置于应用程序包中的代码之外的任何可解释代码- 由用户输入。

Objective C and C will likely still be the most optimal programming language for anything requiring high performance and the latest API support (* see update below), as those are the languages for which Apple targets its iOS frameworks and tunes its ARM processor chipsets. Apple also supports the use of Javascript/HTML5 inside a UIWebView. Those are the only languages for which Apple has announced support. Anything else you will have to find support elsewhere.

对于需要高性能和最新 API 支持(* 请参阅下面的更新)的任何事物,Objective C 和 C 可能仍然是最理想的编程语言,因为这些语言是 Apple 以其 iOS 框架为目标并调整其 ARM 处理器芯片组的语言。Apple 还支持在 UIWebView 中使用 Javascript/HTML5。这些是 Apple 宣布支持的唯一语言。其他任何事情都必须在其他地方寻求支持。

But, if you really want, there are at least a half dozen BASIC interpreters now available in the iOS App store, so even "Stone Age" programming methodology is now allowed.

但是,如果您真的想要,iOS 应用商店中现在至少有六个 BASIC 解释器可用,因此现在甚至允许使用“石器时代”编程方法。

Added: (*) As of late 2014, one can also develop apps using Apple's new Swift programming language. As of early 2015, submitted binaries must include 64-bit (arm64) support.

补充:(*) 截至 2014 年底,还可以使用 Apple 的新 Swift 编程语言开发应用程序。截至 2015 年初,提交的二进制文件必须包含 64 位 (arm64) 支持。

回答by gral.pancho.villa

With plans to slowly retire the long-used Objective-C, Apple has introduced a new programming language, called Swift, for designing apps and applications to run on Apple iOS devices and Apple Macintosh computers.

随着计划逐步淘汰长期使用的 Objective-C,Apple 推出了一种名为 Swift 的新编程语言,用于设计在 Apple iOS 设备和 Apple Macintosh 计算机上运行的应用程序和应用程序。

Apple says: "Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, more flexible, and more fun. Swift's clean slate, backed by the mature and much-loved Cocoa and Cocoa Touch frameworks, is an opportunity to reimagine how software development works."

Apple 表示:“ Swift 是一种适用于 iOS 和 OS X 应用程序的新编程语言,它建立在 C 和 Objective-C 的最佳基础之上,没有 C 兼容性的限制。Swift 采用安全的编程模式并添加了现代功能,使编程更容易、更多灵活,更有趣。Swift 的全新版本,以成熟且广受欢迎的 Cocoa 和 Cocoa Touch 框架为后盾,是重新构想软件开发工作方式的机会。

Introducing swift

快速介绍

enter image description here

在此处输入图片说明

回答by J?rg W Mittag

What programming languages can one use to develop iPhone, iPod Touch and iPad (iOs) applications?

可以使用哪些编程语言来开发 iPhone、iPod Touch 和 iPad (iOs) 应用程序?

Ruby, Python, Lua, Scheme, Lisp, Smalltalk, C#, Haskell, ActionScript, JavaScript, Objective-C, C++, C. That's just the ones that pop into my head right now. I'm sure there's hundreds if not thousands of others. (E.g. there's no reason why you couldn't use any.NET language with MonoTouch, i.e. VB.NET, F#, Nemerle, Boo, Cobra, ...)

Ruby、Python、Lua、Scheme、Lisp、Smalltalk、C#、Haskell、ActionScript、JavaScript、Objective-C、C++、C。这些只是我现在想到的那些。我敢肯定还有数百甚至数千其他人。(例如,没有理由不能在 MonoTouch 中使用任何.NET 语言,即 VB.NET、F#、Nemerle、Boo、Cobra 等)

Also are there plans in the future to expand the amount of programming languages that iOs will support?

未来是否有计划扩大 iO 将支持的编程语言数量?

Sure. Pretty much everyprogramming language community on this planet is currently working on getting their language to run on iOS.

当然。这个星球上几乎每个编程语言社区目前都在努力让他们的语言在 iOS 上运行。

Also, a lot of people are working on programming languages specifically designed for touch devices such as iPod touch, iPhone and iPad, e.g. Phil Mercurio's Thyrdlanguage.

此外,很多人正在研究专为 iPod touch、iPhone 和 iPad 等触控设备设计的编程语言,例如 Phil Mercurio 的Thyrd语言。

回答by Mat

The programming language of iOS(and Mac OS) is Objective-C and C. You have to use Xcode platform to develop iOS apps, on the next version that is now available on beta release, Xcode 4 supports also C++.

iOS(和 Mac OS)的编程语言是 Objective-C 和 C。你必须使用 Xcode 平台来开发 iOS 应用程序,在现在提供 beta 版本的下一个版本中,Xcode 4 也支持 C++。

回答by Ashish Agarwal

It is also now possible to use OCaml for developing iOS applications. It is not part of the standard distribution and requires modifications provided by the Psellos company. See here for more information: http://psellos.com/ocaml/.

现在也可以使用 OCaml 来开发 iOS 应用程序。它不是标准发行版的一部分,需要由 Psellos 公司提供修改。有关更多信息,请参见此处:http: //psellos.com/ocaml/

回答by shaond

This might be an old thread, but I'd like to mention Appcelerator Titanium, which allows anyone versed in HTML5/JavaScript/CSS to develop iOS applications.

这可能是一个旧线程,但我想提一下Appcelerator Titanium,它允许任何精通 HTML5/JavaScript/CSS 的人开发 iOS 应用程序。

回答by dwursteisen

Only Objective-C is allowed by now... but since a few months ago you are allowed to write scripts that will be interpreted in your application.

现在只允许使用 Objective-C ……但是从几个月前开始,您可以编写将在应用程序中解释的脚本。

So you may be able to write a LUA interpreter or a Python interpreter, then write some part of your application in this scripting language. If you want your application accepted on the App Store, these scripts have to be bundled with the application (your application cannot download it from the Internet for example)

因此,您可以编写 LUA 解释器或 Python 解释器,然后用这种脚本语言编写应用程序的某些部分。如果您希望您的应用程序在 App Store 上被接受,这些脚本必须与应用程序捆绑在一起(例如,您的应用程序无法从 Internet 下载)

see new app store rules

查看新的应用商店规则

回答by Aaron Saunders

objective-c is the primary language used.

Objective-c 是使用的主要语言。

i believe there is a mono touch frameworkthat can be used with c#

我相信有一个可以与 c# 一起使用的单声道触摸框架

Adobe also is working in some tools, one is this iPhone Packagerwhich can utilize actionscript code

Adobe 也在开发一些工具,一个是这个iPhone Packager,它可以利用 actionscript 代码

回答by Kibernetik

You can use "smart BASIC" programming language. It is a genuine but very advanced BASIC language with all its power and simplicity. Using its free SDK, BASIC code can be easily published as a standalone App Store application. There are many apps in App Store, written in "smart BASIC" programming language.

您可以使用“智能 BASIC”编程语言。它是一种真正但非常先进的 BASIC 语言,具有所有的功能和简单性。使用其免费 SDK,BASIC 代码可以轻松发布为独立的 App Store 应用程序。App Store 中有很多应用程序是用“smart BASIC”编程语言编写的。