1-1:
1-1-1:LoginRegister 【1】 设置圆角样式:TextField : borderStyle
Button:layer.cornerRadius
【2】字符串为空: @""
【3】return:让代码执行完此方法不再执行
【4】登录时用户名和密码&&都要判断
【5】 同一个页面想转换不同的视图: bringSubviewToFront
1-1-2: StringOrInt 【1】字符串- ->基本数据类型(除NSInterger):类型Value
基本数据类型- ->字符串: stringWithFormat
1-2:
1-2-1:UIViewController:【1】xcode7以上SingleView之前必须要有根视图控制图,否则项目或者代码就会崩溃[加载模拟器]
【2】 创view的情况:
1. 当我们把视图控制器加到window上的时候
2. 当我们调用self.view的时候
【3】 视图控制器放在根视图控制器上,view是放在window上的
1-2-2:Xib 【1】创建文件时自动加上
2-2:
2-2-1:AddXib 【1】拖拉控件,自动设置属性@pro(weak)或者{ __weak IBOutlet}和方法(参数为(id)sender),不用手写
【2】IBOutlet 是接口的意思,连接UILabel代码和Xib文件的一个纽带
2-2-2:AddAloneXib 【1】单独建立Xib文件,关联其他。
//1.点住File owner 右上角第三个选择类输入ViewController
//2.右键点击File owner 选中View,拖拉到Xib的视图中
2-2-3:NSTimer: 【1】建立SingleView,会带mainboard和ViewController
【2】点击按钮时两种方法:定义一个BOOL或者判断定时器是否为空
2-2-4:NSTimerFire 【1】 定时器17张照片不断重复(static,i++,i<17,i=1)
2-2-5:SingleView 【1】建立SingleView,会带mainboard和ViewController,不需要rootViewController
2-3:
2-3-1:NSArray 【1】不可变数组[类 arrayWithObjects:][对象 initWithObjects] 查:index
【2】可变数组[initWithCapacity]增:add/insert 删:remove 改:exchange 查:遍历
2-3-2:UIViewAnimation 【1】代理方法:自己写,调用系统(调用里写会死循环)
【2】开启动画 [UIView beginAnimations:nil context:nil]; (CAAnimation *)anim=beginAnimations
【3】//判断是否添加控件成功:View右键看黑色区域,圆圈,右上角右侧第五个显示箭头
3-1:
3-1-1:AnimationGroup:【1】[数组 addObject:图片对象];
【2】开启动画 [_bgImageView startAnimating];
【3】动画N秒后停止performSelector[_bgImageView stopAnimating];
【4】无限循环RepeatCount=0
3-1-2:Define 【1】形参,大写,最前面,无分号,使用时给类型
3-1-3:SnowDown 【1】控件右面第一个不点中USE layout 利用定时器延迟1s加载属性 使用按钮的动画 viewDidAppear方法
【2】+ (void)beginAnimations:(NSString *)animationID context:(void *)context;
【3】多参方法声明@selector(animationDidStop:finished:context:)
3-2:
3-2-1:AnimationTransform【1】3种找Window方法
【2】翻页forView: 如果是两个页面动画跳转,就需要传值为window。如果只是一个界面的view做动画,直接传self.view
【3】Empty:已经设置好rootViewController
3-2-2:AvdioPlayer 【1】导入系统文件:蓝色-箭头target第一个-build phases-导入
3-2-3:SnowResue 【1】自定义类 创造雪花 设置tag值
4-1:
4-1-1:NSThread: 【1】OC开启分线程有三种方法:
1.NSThred 这种也有3种方法(两种减号方法,一种加号方法传参)
1. NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(run) object:nil];
2. [NSThread detachNewThreadSelector:@selector(run:) toTarget:self withObject:@"123"];
3. [self performSelectorInBackground:@selector(run) withObject:nil];
2.NSOperation
3.GCD
【2】分线程回主线程[self performSelectorOnMainThread:@selector(main) withObject:nil waitUntilDone:YES];
no:就是分线程和和主线程同时执行(代码先后执行) 这是分线程。-----m-----这是主线程。
yes:不会同时执行,会调到主线程,执行完毕后再调到分线程没有完成的任务(main出发顺序逻辑执行) --这是主线程。-----m
4-1-2:NSThreadImaged: 【1】设置安全性 info.plist文件
4-1-3:Tomcat 【1】建立三个数组,通过tag值来获取内容
【2】00-10这样的数时,采用02%d
4-2:
4-2-1:EllipticMotion 【1】设置控件的大小 frame 和 center+bounds[x,y无用]
4-2-2:CycleMotion: 【1】tag值设置9个地球,设置运动不相撞
【2】局部变量要记得赋值给全局变量
5-1:
5-1-1:NineBox: 【1】最好用单层循环,这样在非平方数时可以用tag值区分
【2】单层循环 通过a%3 a/3这样可以数组行列的下标值
5-2:
5-2-1:Tag : 【1】通过Tag值重新定义获取局部变量的控件(viewWithTag)[TouchesBegan]
5-2-2:UISlider: 【1】控件添加方法时,参数为同类型,直接使用即可
5-2-3:UIStepper: 【1】wraps、autorepeat、continuous、
6-1 :
6-1-1:UINavigation: 【1】建立Empty Application文件中Appdelegate 会自带根视图将导航条的根视图设置改为first,将根视图设置为导航; self.window.rootViewController=nav;
【2】在First中点击空白区域,将Second push到first上[self.navigationController pushViewController:second animated:YES];(对象不消失)
【3】在Second中点击空白区域,将自身pop到First [self.navigationController popViewControllerAnimated:YES];(对象消失)
【4】UINavigationController 对象 = self.navigationController
【5】UINavigationController继承于UIViewController UIResponder
6-1-2:CustomNavigation: 【1】每一个视图都要自定义导航控件(导航条+状态栏)
6-2:
6-2-1:UIBarButtonItem: 【1】创建系统
【2】自定义按钮,设置大小
【3】按钮上加图片想显示字就用setBackground
【4】Item加载时需要初始化用initWithCustomView
6-2-2:UIBarButtonitem: 【1】导航标题:设置标题下一页按钮为标题
【2】返回:当前页按钮为内容(不需方法),下一页需设置方法,覆盖系统的
6-2-3:UIByValueNav: 【1】1.正向 无中间 错 first里赋值,接收 懒加载视图second创建失败
2.正向 有中间 对 first里赋值secondPeople second接受secondPeople 不涉及second懒加载视图
3 反向 无中间 对 first里viewwillappear second数组 懒加载视图创建成功
4 反向 有中间 对 first里viewwillappear接收firstPeople second数组 懒加载视图创建成功