iOS平台基础构架
iOS 程序构架结构
无论是swift、Objective-C、C/C++都是编译型语言,与运行时语言不同的是,程序代码都需要经过编译方可运行。
iOS的程序使用LLVM构建,程序位于“应用层“,其底层从上到下,依次是:Cocoa Touch、Media、Core Services、Core OS。
命令行编译&执行
编译:
clang -fobjc-arc HelloWorld.m -o HelloWorld
`</pre>
<pre>`gcc -fobjc-arc HelloWorld.m -o HelloWorld
`</pre>
- clang、gcc均可用执行编译
- -fobjc-arc 表示支持内存管理,ARC内存应用计数管理。
- .m表示需要编译的文件
- -o表示编译输出的文件名为HelloWorld
执行:`./HelloWorld
执行编译的结果
gcc是C/C++的开源编译构架,但是iOS平台的构架是基于clang的,clang在功能方便对其做了一些列优化!
Objective-C的编译过程
从上到下,依次是苹果针对自身平台做的优化!(蓝色部分)
一般建议使用第三种方式进行编译。
WWDC Videos
Videos List https://developer.apple.com/videos/
WWDC2015 https://developer.apple.com/videos/wwdc2015/
WWDC2014 https://developer.apple.com/videos/wwdc2014/
WWDC2013 https://developer.apple.com/videos/wwdc2013/
WWDC2012 https://developer.apple.com/videos/wwdc2012/
WWDC 2011 https://developer.apple.com/videos/wwdc2011/
Documents
About Objective-C https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011210-CH1-SW1
About Swift https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/
Swift.org https://swift.org
Github to Learn iOS
Awesome Swift Education[EN] https://github.com/hsavit1/Awesome-Swift-Education
免费编程书籍[CN] https://github.com/justjavac/free-programming-books-zh_CN#ios
iOS初学者入门[CN] https://github.com/eseedo/kidscoding
Trip to iOS[CN,EN] https://github.com/Aufree/trip-to-iOS
iOS Blogs[CN] https://github.com/tangqiaoboy/iOSBlogCN