19

I'm new to Xcode and I need to know how to use the Detail Disclosure button that I have added to my table. The round blue arrow button when pressed will redirect the user to another ViewController, and in that ViewController, the data in the selected row will be displayed. I'll be using it for updating purposes. I'm apologize for my lack of knowledge about iOS programming. Please be patient with me. Thanks! :)

Lorenz de Guzman
  • 241
  • 1
  • 3
  • 12
  • 1
    Also, if you're using storyboards and have a prototype cell, you can have a segue from the accessory disclosure button to the next scene, too. – Rob Jan 28 '13 at 04:06

3 Answers3

34

The correct tableView delegate method is :

-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

-Basically the detail disclosure button is useful for displaying some extra info in your tableView other than the main info that is invoked when the user selects the row (i.e. the didSelectRowAtIndexPath method)

Tommy Devoy
  • 13,441
  • 3
  • 48
  • 75
7

Delegate Method In Swift 3.0

func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {

}

But for Use this delegate : you can use either of following two accessory Type :

cell.accessoryType = .detailDisclosureButton
cell.accessoryType = .detailButton
Ketan P
  • 4,259
  • 3
  • 30
  • 36
-1

All the detail disclosure indicator does is let the user know that they can (and should) tap on the cell or arrow to show more information. To show the additional information, you will want to handle the -didSelectRowAtIndexPath delegate method for your tableview. From there you can push another view controller or show anything relevant to your selected cell.

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86