Marcel Marino
Marcel Marino

Reputation: 1002

UITableViewCell "OnClick" Method for iPad

I am well aware there is no literal method called "OnClick" for UITableViewCell, but I need something that works similarly. I have a table, and am populating the table with file names of .pdf files, so I need to set it up where where the user clicks on the row, it will open up the .pdf. The opening part I can handle on my own, but I can't seem to get it to respond to being selected. I thought I found a few lines of code that would work, but it just doesn't respond, so perhaps I'm simply putting it in the wrong spot. any help would be appreciated. I am working with a standard view based application.

Upvotes: 1

Views: 2326

Answers (1)

GregularExpressions
GregularExpressions

Reputation: 523

Do you just need to know when someone selects a row in your table? Not individual items within a cell?

If so then UITableViews have a delegate method of - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath. Implement that in your tableView's delegate and it'll be called each time someone selects a row.

Upvotes: 2

Related Questions