block使用时不判空,当使用的block没有实现,会crash。
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
self.backgroundColor = [UIColor whiteColor];
if (self) {
for (int i = 0; i<3; i++) {
ImageTitleButton *btn = [[ImageTitleButton alloc]initWithType:ImageTopTitleBottom andTitleFont:NFont(13) andTitle:@[@"好友",@"关注",@"粉丝"][i] andImage:[UIImage imageNamed:@[@"friends",@"follow",@"fans"][i]] andFrame:CGRectMake(0, 0, PPImageTitleBtnW, PPImageTitleBtnH)];
// if(self.clickAction)
{
self.clickAction(button.titleButton.titleLabel.text,button);
}
}];
if (i == 0) {
}
}
[self upFrame];
}
return self;
}