简体   繁体   中英

Linking View Controllers to TableView entries

I have made a table view, with 19 entries. What I would like is to have each one connected individually to a view controller, since all the view controllers are going to be different.

The code I've used for the tableView is:

tableData = [NSArray arrayWithObjects:@"One", @"Two",[...], nil];

Is there a way to connect each one of those entries to a seperate view controller?

You need to use the UITableViewDelegate methods. The one you will need to implement for this is:

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

see also apple documentation: here

hope this helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM