Why shouldn't I subclass a UIButton?
问题 I\'ve asked a few questions on stack overflow about subclassing a UIButton , and a couple of people have informed me that I shouldn\'t subclass a UIButton . What are the negatives of subclassing a UIButton ? And I know it\'s vague, but what are other alternatives to subclassing a UIButton ? 回答1: The Cocoa frameworks take the approach that the Object Composition pattern is more appropriate than traditional class hierarchy. In general, this means that there is likely to be a property on