1.IOS解惑(1)之@property(nonatomic,getter=isOn) BOOL on;中的getter解惑
//如果这个property是 BOOL on,那么Objc默认创建的 setter 为:
- (void)on:(BOOL)setOn
{
}
//getter 为:
- (BOOL)on
{
return on;
}
//但是你可以手动更改 setter 和 getter 方法,就像上面的:getter = xxxOn 的话,
//getter 就变为:
- (BOOL)xxxOn
{
return on;
}
原文:http://www.cnblogs.com/erdeng/p/4911572.html