Sorry if I’m understanding your English incorrectly, but I guess this is along the lines of what you want:
You can get the indexPath of the row that was selected in a table by implementing tableView:didSelectRowAtIndexPath:
in you tableView’s delegate (presumably your tableViewController). An indexPath has two properties you’ll be interested in; section
and row
. If you have one section in your table, and one 1d array of data, you can simply use something like this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MyObject *object = [self.myListOfObjects objectAtIndex:indexPath.row];
}
If you have more than one section, you will need to use indexPath.section as well, depending on what your model looks like.
7
solved How to get index of array element in cell? [closed]