XCode 中的语言
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13969392/
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
Languages in XCode
提问by Patrick Reck
I'm just about to start learning how to program using XCode. I've had Java lessons in my school for half a year now, and will continue with that for the next 2 years.
我即将开始学习如何使用 XCode 进行编程。我已经在我的学校上过半年的 Java 课程了,并将在接下来的 2 年里继续这个课程。
As far as I've looked into XCode, it looks like it just uses Objective C, which at my brief first sight, looks pretty different from Java syntax-wise. Look at C at the other hand, looks a lot more like Java.
就我所研究的 XCode 而言,它看起来只是使用了 Objective C,在我短暂的第一眼中,它看起来与 Java 的语法非常不同。另一方面看C,看起来更像Java。
Now I am wondering, is it possible to write iOS applications in C using XCode? It definitely would easen up my learning curve not having to learn a whole new syntax on top of a new language.
现在我想知道,是否可以使用 XCode 用 C 编写 iOS 应用程序?它肯定会减轻我的学习曲线,而不必在新语言之上学习全新的语法。
Edit: If it is indeed possible, would there be any disadvantages in using C instead of the (seems encouraged?) Objective-C?
编辑:如果确实有可能,使用 C 而不是(似乎受到鼓励?)Objective-C 会有什么缺点吗?
回答by Anoop Vaidya
First of all welcome in XCode
.
首先欢迎进入XCode
。
XCode is just an IDE. Now it is on you, whether you want to learn iOS or MacOS Applications.
XCode 只是一个 IDE。现在就在你身上,无论你是想学习 iOS 还是 MacOS 应用程序。
And I would suggest you if you have a good knowlegde of C, then have some knowledge on Object oriented language like C++ or Java. Then you will feel comfortable with Objective-C.
我建议你如果你对 C 有很好的了解,然后对 C++ 或 Java 等面向对象的语言有一些了解。然后你会对Objective-C感到舒服。
Objective-C is a language, superset of C, so not much to think only one day learning is required to see the changeover from C to Obj-C.
Objective-C 是一种语言,是 C 的超集,所以不用多想,只需要一天学习就可以看到从 C 到 Obj-C 的转换。
And Obj-C language makes framework called "Cocoa" which is the core for ios and mac based development. This will take some time, but mind you, you will get thousands of API, which are easier to use and remember than what you will make and use from 'C'.
Obj-C 语言制作了名为“Cocoa”的框架,它是基于 ios 和 mac 开发的核心。这将需要一些时间,但请注意,您将获得数以千计的 API,它们比您将从“C”创建和使用的内容更易于使用和记住。
You can refer many sites, I would like to share my learning process with you.
你可以参考很多网站,我想和你分享我的学习过程。
You can follow these, even I started learning with these sources.
您可以关注这些,即使我是从这些来源开始学习的。
Stanford lectures CS193
Lynda's Videos
Cocoa Programming for Mac OS X by Aaron Hillegas
Cocoadevcentral.com
Last one is of course Stack Overflow... This is the best place to sort out all your doubts.
斯坦福讲座 CS193
琳达的视频
Cocoa Programming for Mac OS X by Aaron Hillegas
Cocoadevcentral.com
最后一个当然是Stack Overflow……这是理清你所有疑惑的最好地方。
回答by Chris McCabe
You can effectively write most of your app in C but when you interact with the iOS SDK, the part that communicates with the device, you will need to use obj-c. Objective-c isn't hard to learn really, don't feel daunted about it.
您可以有效地用 C 编写大部分应用程序,但是当您与 iOS SDK(与设备通信的部分)进行交互时,您将需要使用 obj-c。Objective-c 并不难学,不要害怕。
回答by Misha
You definitely can write code in C. Objective-C is a C language wrapped by defines.
你绝对可以用 C 编写代码。Objective-C 是一种由定义包装的 C 语言。
However, I'd recommend to learn Objective-C. This allows you to write code using Object Oriented principles. There are numerous online tutorials for this.
但是,我建议学习Objective-C。这允许您使用面向对象的原则编写代码。有许多在线教程。