IOS开发进阶-入门

来源:互联网 发布:手机上安装linux 编辑:程序博客网 时间:2024/06/18 14:49

1.开发技巧,编程思想,设计理念很重要

2.ios系统架构:

IOS是基于UNIX的,直接与底层硬件通信,系统底层,应用框架,应用软件都是采用C ,C++,Object-c,开发的,所以运行效率较高。

iOS得系统分为四个层次:

核心操作系统层 core os

核心服务层  core service

媒体层 media

可触摸层 cocoa touch

3.Cocoa Touch

主要在Cocoa Touch层,其中有个非常重要得UIKit 框架,为应用程序提供了各种各样得可视化组件。

例子:

@interface WSLViewController : UIViewController//-(IBAction)btnClick;//声明两个属性来保存两个文本的值@property (nonatomic,weak)IBOutlet UITextField *text1;@property (nonatomic,weak)IBOutlet UITextField *text2;@property (nonatomic ,weak)IBOutlet UILabel *display1;@end

@implementation WSLViewController-(void)btnClick{    NSString *s1=self.text1.text;    NSString *s2=self.text2.text;    int sum=[s1 intValue]+[s2 intValue];    NSString *b=[NSString stringWithFormat:@"%d",sum];    self.display1.text=b;}- (void)viewDidLoad{    [super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.}- (void)didReceiveMemoryWarning{    [super didReceiveMemoryWarning];    // Dispose of any resources that can be recreated.}@end

IBAction 和  IBOutlet的关系


4.程序的启动过程

加载最主要的storyboard文件

创建白色箭头所指的控制器对象

创建控制器内部的view,显示到用户眼前


0 0