Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ataylor2009

macrumors member
Original poster
Jan 27, 2009
78
0
Is it possible to have a table view that fires one action when the label is tapped, and a different action when the detail disclosure button is tapped? I'd like to perform a task when the user taps the table row, but I'd like to navigate to a subview if the detail chevron is tapped.

Thanks in advance for a nudge in the right direction.
 
Is it possible to have a table view that fires one action when the label is tapped, and a different action when the detail disclosure button is tapped?
Yes, it's possible. In fact, that's exactly how the cell selection vs. accessory button tapped is designed to work. See the UITableViewDelegate Protocol Reference as well as the "Table View Programming Guide for iPhone OS" for more info.
 
As is clearly stated in the documentation tableView:accessoryButtonTappedForRowWithIndexPath will be sent when the accessoryType is UITableViewCellAccessoryDetailDisclosureButton. If the accessoryType is UITableViewCellAccessoryDisclosureIndicator then this won't happen.

If you need the display of UITableViewCellAccessoryDisclosureIndicator but want to track clicks on the accessory view define a custom UIControl (not UIView) subclass that draws the view you want and have it send the action you want.
 
(Sheepishly...) Sorry folks. I should've looked harder before asking. I was trying to fire off a quick post while I was on break and didn't have access to the documentation.

Thanks for the assist.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.