我创建了一个自定义切换按钮类,它继承自UIButton。我在故事板上将按钮添加到UITableViewCell,并在Identity Explorer的Custom - >中分配了类“LmxStartStopToggleButton”。课程部分。对于UITableViewCell,我创建了一个自定义类“LmxRijtijdTableViewCell”并按住Ctrl键拖动到IBOutlet“rijtijdBtn”
@property IBOutlet LmxStartStopToggleButton *rijtijdBtn;
LmxStartStopToggleButton *btn = ((LmxStartStopToggleButton *)self.rijtijdBtn);
答案 0 :(得分:1)
确保您的单元格中没有其他元素指向" rijtijdBtn。"
如果这不是问题,请确保该按钮的类型为" LmxStartStopToggleButton"单击界面编辑器中的按钮,转到右侧工具栏右侧的第3个选项卡,然后确保在" Custom Class"它说" LmxStartStopToggleButton。"