OC 继承章节中 有这么一段代码
#import <Cocoa/Cocoa.h>
@interface square : Rectangle
-(void)setSide:(int) s
{
[self setWidth:s andHeight: s ];
}
-(int) side
{
return self.width;
}
@end
// 用到 self 则表示 setWidth 、andHeight、 self.width
square类不能访问到这些继承过来的实例变量(说明他们是在父类Rectangle 中定义为私有的)
self.width // 发送width消息到该方法(side) 消息的接收者 (父类 Rectangle)