Hello!

I continue my study obj c. And I have a question. I made 3 pages in PageViewController, on each of them there is a TableView. I want to make sure that when you click on a cell on each individual page, the transition is organized into your ViewController. I can’t imagine how this can be done, tell me, I will be glad, and if I’m an example of such an organization in any project, I’m very happy.

At the moment, when I switch from any of the pages, I have a transition to a single ViewController.

  • @ Gool12222, If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - Vitalina

1 answer 1

If a storyboard used, we wrap from the original UIViewController with the ctrl segue pressed to the one to go to, set the settings to segue type = push / show, identifier = "GoDetails1". The transition is not projected from the table or button cell or any other control, but from the controller itself (the yellow square at the top). Next we implement the UITableViewDelegate method, something like that (I write on swift, on Obj-C it will be the same):

 func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { switch (indexPath.section, indexPath.row) { case (_, 0): performSegueWithIdentifier("GoDetails\(indexPath.row)", sender: self) default: println("No segue setup for indexPath \(indexPath)") } } 

You just need to track which cell was selected and call respectively performSegueWithIdentifier("segue_identifier", sender: AnyObject!) With the appropriate identifier.