iOS overview

iOS devided 4 layers:

core os: unix kernel and C API

core service: object-oriented service API

multimedia: multimedia is embed into the system design

cocoa tough: user interface library, service library

devide all your classes into 3 camps:

Model: what your application does

Controller: how your model is presented in the UI

View: Controller’s minions, the controllers uses it to present the model on screen

The model-view communication:

the controller can access the model

the model never communicate to the controller, it defines notification to broadcast things interesting to controller

The controller-view communication:

controllers uses an outlet to talk to view

view can’t communicate to the controller via:

target/action mechanism


controller works as data source, delegates for model

Controllers can talk to many models and other controllers, but view can only be controlled by only one controller,and never communicate to models.

3. Objective-C

a strict super-set of C

header file as .h, source file as .m

#import works like #include, smarter (good!)

@interface and @end in header file

@implementation and @end in source file

public versus private is just it is in header or source file (good!)

can have @interface in source file, be private

arguments are interspersed in the name of the methods (great!)

(void)orbitPlanet:(Planet * aPlanet):atAltitude:(double* )km;

@property (nonatomic) double topSpeed;

@synthesize topSpeed = _topSpeed;

call a method

[self topSpeed] => self.topSpeed

[ self. nearestWormhole travelToPlanet:aPlanet atSpeed:speed]


Similar Posts


邮箱地址不会被公开。 必填项已用*标注