oberbaum
oberbaum

Reputation: 2448

iPhone UITableView - action on accessory click

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 UITableView) to a method?

Upvotes: 11

Views: 12817

Answers (2)

Carl Bruiners
Carl Bruiners

Reputation: 87

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

Upvotes: 0

Greg Martin
Greg Martin

Reputation: 5064

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

Upvotes: 30

Related Questions