Reputation: 307
I've often used prepareForSegue to pass stuff forward to the next view controller. No problem when my tableview doesn't use sections. But I've added sections to my latest project. Now I don't know how to use prepareForSegue because it doesn't receive the indexpath, which contains the section reference. What am I missing? Thanks for the help!
Upvotes: 2
Views: 151
Reputation: 104082
In your prepareForSegue method, just use:
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
and pass that along to the destinationViewController.
Upvotes: 3