博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
01-Stanford-Overview of iOS & MVC 摘要及笔记
阅读量:4315 次
发布时间:2019-06-06

本文共 2100 字,大约阅读时间需要 7 分钟。

一.  iOS的整体架构图

 

<1>Cocoa Touch 

该层提供了构建iOS应用的一些基本系统服务(如多任务、触摸输入、推送通知)和关键框架。

<2>Media

Media层提供了图形、音频、视频、Aiplay技术。

<3>Core Services

该层提供了iCloud、应用内购买、SQLite数据库和XML支持技术。

<4>Core OS

该层提供了一些低级功能(如管理证书重力加速计等),开发中一般不直接使用它。

 

二.  MVC

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.快速枚举

转载于:https://www.cnblogs.com/flyingX/p/3503828.html

你可能感兴趣的文章
应用程序缓存的应用(摘抄)
查看>>
jQuery基础知识,很赞的!!!
查看>>
JK_Rush关于索引的一些总结
查看>>
[Codevs] 线段树练习5
查看>>
Amazon
查看>>
component-based scene model
查看>>
Echart输出图形
查看>>
hMailServer搭建简单邮件系统
查看>>
从零开始学习jQuery
查看>>
Spring+SpringMVC+MyBatis深入学习及搭建(四)——MyBatis输入映射与输出映射
查看>>
opacity半透明兼容ie8。。。。ie8半透明
查看>>
CDOJ_24 八球胜负
查看>>
Alpha 冲刺 (7/10)
查看>>
一款jQuery打造的具有多功能切换的幻灯片特效
查看>>
SNMP从入门到开发:进阶篇
查看>>
@ServletComponentScan ,@ComponentScan,@Configuration 解析
查看>>
unity3d 射弹基础案例代码分析
查看>>
thinksns 分页数据
查看>>
os模块
查看>>
LINQ to SQL vs. NHibernate
查看>>