ios day1

1.IBAction:
1> 能保证方法可以连线
2> 相当于void

2.IBOutlet:
1> 能保证属性可以连线

3.常见错误
setValue:forUndefinedKey:]: this class is not key value coding
错误原因是:连线出问题了

4.Xcode5开始的一些建议
把用于连线的一些方法和属性声明在.m文件的类扩展中

5.frame\center\bounds
1> frame:能修改位置和尺寸
2> center:能修改位置
3> bounds:能修改尺寸(x\y一般都是0)
4> transform:位置\尺寸\旋转角度

6.简易动画实现的两种方式
(1) 头尾式
[UIView beginAnimations:nil context:nil];
/**需要执行动画的代码**/
[UIView commitAnimations];
(2)Block式
[UIVIew animateWithDuration:0.5 animations:^{
/**需要执行的代码**/
}]

猜你喜欢

转载自invictus-fang.iteye.com/blog/2136270