2013年2月21日

Anonymous Type and Heterogeneous Containers

摘要: Objective-C defines the type id, which is known as the Anonymous Type. The id type tells the compiler that a variable pointss to an object but doesn't give the compiler any more specific information about the kind of object, hence the object is anonymous.MotivationUse the Anonymous Type pattern 阅读全文

posted @ 2013-02-21 22:54 Chansonyan 阅读(274) 评论(0) 推荐(0)

Category

摘要: pp63The Category pattern adds methods to existing classes and provides an alternative to subclassing in many situations. The added methods are inherited by all subclasses of the extended class and are indistinguishable at runtime from methods originally compiled into the class.The Category pattern c 阅读全文

posted @ 2013-02-21 00:06 Chansonyan 阅读(171) 评论(0) 推荐(0)

导航