我有一个带有UITableViewController
. 在这个控制器中,我有静态单元格,其中一个是UITableViewCell
. 在 IB 中,我UIButton
向这个静态单元格添加了 a 并将其连接到子类IBAction
中的an UITableViewCell
。但是,IBAction
从未调用过。为什么这不起作用?如何实现所需的行为,其中单元格内的按钮通过 IB 触发事件?
。H
#import <UIKit/UIKit.h>
@interface BSWorkoutsCell : UITableViewCell
@property (nonatomic, weak) IBOutlet UIButton *button;
@property (nonatomic, strong) IBOutletCollection(UIButton) NSArray *buttons;
- (IBAction)tapButton:(id)sender;
@end
.m
- (IBAction)tapButton:(id)sender{
if (!_buttonsHidden){
[self animateHideButtons:(UIButton *)sender];
_buttonsHidden = YES;
}
}
图片