一. iOS的总体架构图数据库
<1>Cocoa Touch 设计模式
该层提供了构建iOS应用的一些基本系统服务(如多任务、触摸输入、推送通知)和关键框架。架构
<2>Mediaapp
Media层提供了图形、音频、视频、Aiplay技术。框架
<3>Core Servicesui
该层提供了iCloud、应用内购买、SQLite数据库和XML支持技术。atom
<4>Core OSspa
该层提供了一些低级功能(如管理证书重力加速计等),开发中通常不直接使用它。设计
二. MVC3d
MVC Design Strategies(网上关于MVC是否为设计模式多种争论,可是在苹果官网的《Start Developing iOS Apps Today》一文设计模式一章,明确指出了MVC为设计模式)
<1>Model
What your application is (but not how it is displayed).
<2>View
Your Controller's minions.
<3>Controller
How your Model is presented to the user(UI logic).
Controllers can always talk directly to their Model and View.
* View怎样和Controller通讯
3.11 View指向Controller的Communication is “blind” and structured.
3.12 The Controller can drop a target on itself,then hand out an action to the View,the View sends the action when things happen in the UI.
3.13 Sometimes the View needs to synchronize with the Controller. The Controller sets itself as the View's delegate ,the delegate is set via a protocol(it is "blind" to class) blind意指什么--->?
3.14 Views do not own the data they display
if need , views have a protocol to acquire it.Controllers are almost always that data source(not Model); Controllers interpret/format Model information for the View.
* Model怎样和Controller通讯
3.21 The Model is (should be) UI independent
3.22 Model uses a"radio station"-like broadcast mechanism.
3.23 Controllers (or other Model) "tune in" to interesting stuff. ---->?
3.24 A View might "tune in",but probably not to a Model's "station" ---->?
三. Objective-C
完整代码
1. properties
Usually we do not access instance variables directly in Objective-C . Instead,we use "properties" .
A"property" is just the combination of a getter method and a setter method in a class.
2.
*类是公共的声明,私有的实现
*在声明文件中声明的方法是公共的
*能够在实现文件的声明部分进行私有方法的声明。
*在实现文件的实现部分直接实现的方法, 而没有在其余任何地方声明的也是私有的方法
3.
在iOS7中,能够用 @import Foundation; (注意句末的分号) 代替 #import <Foundation/Foundation.h>
4.
iOS不直接拥有实例变量;指针;堆;公共方法的声明
5.strong 、weak和nonatomic
6.基本数据类型 BOOL
7.getter方法的重命名
8.isEqualToString:
9.快速枚举