How do I programmatically get the state of UIBarButtonItems?
问题 With a UIControl such as a UIButton you can use something like myControl.state to figure out whether the control is currently being pressed down. However, I need to do the same with some UIBarButtonItems (which are not derived from UIControl ), so that I can stop my table from editing while one of them is pressed down. Here's my code: - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { //other checks for(int b=0; b<self.toolbar.items.count; b++) {