storyboard连线容易出现的问题
- 连接的方法代码被删掉,但是连线没有去掉
- 可能会出现方法找不到错误
- unrecognized selector sent to instance
- 连接的属性代码被删掉,但是连线没有去掉
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- 如果遇到这种错误,90%的可能都是因为连线有问题,比如一些线已经“过期”
- 'NSUnknownKeyException', reason: '[setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
IBAction和IBOutlet区别
IBAction
- 从返回值角度上看,作用相当于void
- 只有返回值声明为IBAction的方法,才能跟storyboard中的控件进行连线
IBOutlet
- 只有声明为IBOutlet的属性,才能跟storyboard中的控件进行连线