Quite simply, how do I push a new view controller from a prototype cell within a storyboard? I have a tableView reading data from a plist file, and its one default prototype cell on the storyboard. Then, I have another view controller in the storyboard I need to link to the tapping of a cell on the table view. How can this be accomplished?
Share
In your storyboard, link your prototype table view cell to your view
controller with a segue. Make sure to give the segue an identifier in
its Attributes Inspector.
In your TableViewController class,
implement
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)senderIn the prepareForSegue: method, get the NSIndexPath of the row the user tapped with
[self.tableView indexPathForSelectedRow]destinationViewControllerproperty of theUIStoryboardSegueparameter passed intoprepareForSegue:.