iOS 开发学习笔记

最近想学习下iOS的开发,在网易公开课上找了个课程,准备先听一下这个课程,做为入门吧。

课程的名字是:斯坦福大学公开课:iPad和iPhone应用开发(iOS5)

链接:http://open.163.com/special/opencourse/ipadandiphoneapplication.html

今天听了第一课,大概讲了如下的内容:

  1. iOS overview

    iOS devided 4 layers:

    1. core os: unix kernel and C API
    2. core service: object-oriented service API
    3. multimedia: multimedia is embed into the system design
    4. cocoa tough: user interface library, service library
  2. MVC

    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:

      1. the controller can access the model
      2. the model never communicate to the controller, it defines notification to broadcast things interesting to controller

The controller-view communication:

      1. controllers uses an outlet to talk to view
      2. view can‘t communicate to the controller via:
        1. target/action mechanism
        2. delegate(should/will/did)
        3. 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]

时间: 2024-08-07 00:13:39

iOS 开发学习笔记的相关文章

IOS开发学习笔记-(2)键盘控制,键盘类型设置,alert 对话框

一.关闭键盘,放弃第一响应者,处理思路有两种 ① 使用文本框的 Did End on Exit 绑定事件 ② UIControl on Touch 事件 都去操作 sender 的  resignFirstResponder #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextField *txtUserName; @pro

iOS开发学习笔记:基础篇

iOS开发需要一台Mac电脑.Xcode以及iOS SDK.因为苹果设备都具有自己封闭的环境,所以iOS程序的开发必须在Mac设备上完成(当然,黑苹果应该也是可以的,但就需要花很多的精力去折腾基础环境),Xcode是一个集成开发环境,包括了编辑器.调试.模拟器等等一系列方便开发和部署的工具,iOS SDK则是开发应用所必需,不同的SDK分别对应不同的iOS版本或设备,通常我们需要下载多个iOS SDK以确保我们开发的程序能够在不同版本的iOS上正常运行. 创建新工程 Xcode提供了很多种工程模

IOS开发学习笔记-(3) 进度条、等待动画开始停止

一.创建对应空间视图  ,如下图: 二.编写对应的 .h 代码,如下 : #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activWaitNetWork; @property (weak, nonatomic) IBOutlet UIProgressView *pgrsDownLo

IOS开发学习笔记(二)-语音识别(科大讯飞)

上次简单地讲解了如何利用科大讯飞完成语音合成,今天接着也把语音识别整理一下.当然,写代码前我们需要做的一些工作(如申请appid.导库),在上一篇语音合成的文章当中已经说过了,不了解的可以看看我上次的博文,那么这次直接从堆代码开始吧. 详细步骤: 1.导完类库之后,在工程里添加好用的头文件.在视图里只用了一个UITextField显示识别的内容,两个UIButton(一个开始监听语音,一个结束监听),然后引入类.添加代理,和语音合成的一样. MainViewController.h 1 #imp

IOS开发学习笔记(1)-----UILabel 详解

1. [代码][C/C++]代码     //创建uilabelUILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 40, 280, 80)];//设置背景色label1.backgroundColor = [UIColor grayColor];//设置taglabel1.tag = 91;//设置标签文本label1.text = @"Hello world!";//设置标签文本字体和字体大小label1.

IOS开发学习笔记(2)-----UIButton 详解

1. [代码][C/C++]代码     //这里创建一个圆角矩形的按钮    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];    //    能够定义的button类型有以下6种,//    typedef enum {//        UIButtonTypeCustom = 0,          自定义风格//        UIButtonTypeRoundedRect,        

IOS开发学习笔记--语音合成(科大讯飞)

      现在语音服务越来越热,我们平时使用的很多软件都带有语音合成和识别功能,用起来也很方便.说到语音服务,Google和微软都提供过API接口,不过笔者要介绍的是国内的智能语音技术提供商---科大讯飞.之前看过一个比较Google.微软和科大讯飞语音识别引擎的博文(http://fqctyj.blog.163.com/blog/static/70843455201361955322797/),有兴趣可以去看看.笔者接触语音服务的时间也不长,对语音服务也不是很了解,但是拆解过科大讯飞的Dem

IOS开发学习笔记017-什么是IOS开发

应用程序开发流程 1.IOS开发需要思考的问题 用户是谁?不同应用程序的内容和用户体验大不相同,这取决于想要编写的是什么应用程序,它可能是儿童游戏,也可能是待办事项列表应用程序,又或者是测试自己学习成果的应用程序. 应用程序的用途是什么?赋予应用程序一个明确的用途十分重要.了解激发用户使用应用程序的动因是界定用途的一个出发点. 应用程序尝试解决什么问题?应用程序应该完美解决单个问题,而不是尝试解决多个截然不同的问题.如果发现应用程序尝试解决不相关的问题,那么最好考虑编写多个应用程序. 应用程序要

ios开发学习笔记(1)

objective-c基础总结 第一二章 1.application:didiFinishLauchingWithOptions:程序启动后立即执行 2.启动界面代码格式:self.window = [UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];//1.从Infor.plist中取出版本号NString *version = [NSBundle mainBundle].infoDictionary[key];//2.