iPhone最受支持的编程语言是哪种? [英] Which is the most supported programming language for the iPhone?
问题描述
我已决定开始为iPhone编写一些应用程序,这些应用程序最终将提交给App Store.因此,我必须使用Apple支持的语言.
I have decided to start programming some apps for the iPhone that eventually will get submitted to App Store. So I have to use a language the Apple supports.
但是,据我了解,我可以选择多种语言.
However, from what I understand, there are some variety of languages I can choose from.
Ansi C
目标C
C
C ++
我从2001年开始在学校学习 C ++
,所以也许我应该使用它.但是,我想使用受支持最多的API和社区wize语言.那是哪一个?
I started learning C++
in school back in 2001, so maybe I should use that. However, I would like to use the language that is most supported API and community wize. Which one is that?
推荐答案
这是最重要的地方:
所有iPhone SDK API都是Objective-C或纯(ANSI)C.纯C API往往是较低级别的API,因此您只能使用Objective-C.但是 Objective-C是C的严格超集,因此您需要在C中有一个合理的基础才能编写Objective-C.
All iPhone SDK APIs are either Objective-C or pure (ANSI) C. The pure C APIs tend to be the lower-level APIs, so you could use just Objective-C. However Objective-C is a strict superset of C, so you'll need a reasonable grounding in C in order to write Objective-C.
完全支持C ++,但不是必需的(没有C ++ API).您甚至可以使用Objective-C ++在同一源中混合使用Objective-C和C ++.如果这样做,最好将C ++用于纯计算组件,将纯Objective-C用于前端,将Objective-C ++用于中间的胶水"层.
C++ is fully supported, but is not required (there are no C++ APIs). You can even mix Objective-C and C++ in the same source using Objective-C++. If you do this it's best to use C++ for pure computational components, pure Objective-C for the front-end, and Objective-C++ for the "glue" layer in the middle.
总而言之:您将需要 C和Objective-C.如果需要,可以将C ++用于某些部分.
In summary: you'll need C and Objective-C. Use C++ for some parts if you particularly need it.
这篇关于iPhone最受支持的编程语言是哪种?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!