のストーリーボードがありUITableViewController
ます。このコントローラーには、静的セルがあり、そのうちの 1 つは のサブクラスですUITableViewCell
。IB で、UIButton
この静的セルにa を追加IBAction
し、UITableViewCell
サブクラスの an に接続しました。ただし、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;
}
}
画像