IBAction:IBOutlet:注意事项

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)

posted on 2017-08-19 13:37  slgkaifa  阅读(117)  评论(0编辑  收藏  举报

导航