I would like to call a method when a UITableViewCell
is selected/tapped. I could do it easily with a static table view, but it requires a UITableViewController
which is not good for me in this case, therefore I'm using a normal vc.
I have 10 specified methods like this:
- (void) methodOne {
NSLog(@"Do something");
}
- (void) methodTwo {
NSLog(@"Do something");
}
....
And I would like to call the methodOne
when the first cell was tapped, call the methodTwo
when the second cell was tapped and so on..
As a first step I set the numberOfRowsInSection
to return 10 cells, but have no idea how could I connect the selected cells with the methods. Is there any quick way to do it? It would be a dirty solution to create 10 custom cells and set the every method manually for the custom cells, and there is no free place for it.