I am creating a custom Radio Button on UITableViewCell. I am confused on implementing a delegate which will notify me for each button selection.
For example, in UITableView, we have a method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
It is called when a user selects the particular row. I would like to have same behavior for my option button selection.
Thanks in advance.
I would suggest you subclass
UIButtonand use the usual target/action semantics instead of reinventing the wheel.However, if you want to implement the delegation pattern generically, there is excellent documentation from Apple in the Cocoa Fundamentals Guide (scroll down to the section titled “Implementing a Delegate for a Custom Class”).