typedef NS_ENUM(NSInteger, UIButtonType) {      UIButtonTypeCustom = 0,                         // no button type      UIButtonTypeSystem NS_ENUM_AVAILABLE_IOS(7_0),  // standard system button      UIButtonTypeDetailDisclosure,      UIButtonTypeInfoLight,      UIButtonTypeInfoDark,      UIButtonTypeContactAdd,      UIButtonTypeRoundedRect = UIButtonTypeSystem,   // DePRecated, use UIButtonTypeSystem instead  };    不管返回什么类型的对象,他们都继承于UIButton。使用者不用关系创建的button属于哪个子类和具体的实现细节。  注意:如果对象所属的类位于某个族类中,查询类的信息时需要注意,对象可能是某个子类的实例,而不是基类的实例。    向族类中新增实体子类,规则:  1.子类应该继承自基类中的某个抽象基类  2.子类应该定义自己的数据存储方式,基类只是众多子类的“壳”,仅仅定义了子类通用的接口  3.子类必须覆写超类中指明需要覆写的方法    要点:  1.类族模式可以把实现细节隐藏在一套公共接口后面  2.系统框架中经常使用族类,UIButton,NSArray
新闻热点
疑难解答