[英]Access UITableViewCell from UITableViewController on button click
Got a UIStepper inside a UITableViewCell (IBAction). 在UITableViewCell(IBAction)中有一个UIStepper。 What I would like is to reset its value property back to 0 from the UITableViewController on a button press (another IBAction).
我想要的是在按下按钮时将UITableViewController的value属性重置为0(另一个IBAction)。
So how can I access my dynamic cells from an a UITableViewController IBAction? 那么如何从UITableViewController IBAction访问动态单元格呢?
Eventually I ended up adding a boolean property named shouldResetToZero in the model representing the cell. 最终,我最终在代表该单元格的模型中添加了一个名为shouldResetToZero的布尔属性。 I would set this to TRUE from the UITableViewController on button press and update the stepper if it's true in cellForRowAtIndexPath.
我将在按钮按下时从UITableViewController将此值设置为TRUE,如果在cellForRowAtIndexPath中为true,则更新步进器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.