标签:
1.NS_DESIGNATED_INITIALIZER
- (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { self.titleLabel.font = [UIFont systemFontOfSize:16]; // 文字颜色 [self setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; [self setTitleColor:[UIColor redColor] forState:UIControlStateSelected]; } return self; }
2.NS_REQUIRES_SUPER
@interface XMGTest : NSObject - (void)run NS_REQUIRES_SUPER; @end @interface XMGSecondTest : XMGTest @end @implementation XMGSecondTest - (void)run { // 不调用, 则会有警告信信 //[super run]; } @end
标签:
原文地址:http://www.cnblogs.com/KeenLeung/p/5373663.html