Scroll View and Table View - Table View

3 important questions on Scroll View and Table View - Table View

What happens every time a user clicks on a row?

delegate message -(void)tableView:(UITableView *)sender didSelectRowAtIndexPath:(NSIndexPath *)path {
} get's send to the delegate object.

How can you create a segue from a tableViewCell?

You just crtl-drag it to the target.

How can you "know" which cell is clicked when you are about to segue?

this method gets called:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSIndexpath *indexPath = [self.tableView indexPathForCell:sender];

}

The sender is the cell that clicked, we find its index path using the method indexPathForCell.

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo