I subclassed TTTableMessageItemCell named CustomTTTableSubtitleItemCell and add a ttbutton in it, now I want to add click action for this button. In CustomTTTableSubtitleItemCell I declared TTButton like:
Code:
- (TTButton*)rightButton {
if (!_rightButton) {
_rightButton = [[TTButton
buttonWithStyle:@"embossedButton:" title:self.rightButtonTitleForCell] retain];
[_rightButton setUserInteractionEnabled:YES];
[_rightButton addTarget:self action:@selector(buttonPressed:event:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.rightButton];
}
return _rightButton;
}
where I can implement "buttonPressed"? It seems cannot be implemented in CustomTTTableSubtitleItemCell, in viewController?
No idea.