开发者

iPhone UITableView - action on accessory click

开发者 https://www.devze.com 2022-12-18 12:48 出处:网络
I am trying to link the click of an accessory button in a UITableView to a method in a particular class. The accessory is on multiple cells, created in code, and thus I can\'t just do a simple link in

I am trying to link the click of an accessory button in a UITableView to a method in a particular class. The accessory is on multiple cells, created in code, and thus I can't just do a simple link in interface builder like I am used to.

How do I link an accessory arrow (from the end of a cell in a UITabl开发者_如何学编程eView) to a method?


Check out the tableView:accessoryButtonTappedForRowWithIndexPath: method on the UITableViewDelegate.


This is no longer valid, Xcode flags a warning it is now depreiated;

WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryButtonTappedForRowWithIndexPath: in . Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior. This method will no longer be called in a future release. See here: https://developer.apple.com/documentation/uikit/uitableviewdelegate

0

精彩评论

暂无评论...
验证码 换一张
取 消