0

I'm a newbie in iOS.

I have a UITableView and a DetailViewController. When I click some elements (like name of user) in a UITableView it will transfer to the DetailViewController. Then I could code for that 2 ViewControllers.

But now I want to be able to click elemens in the DetailViewController so that it will move to another DetailViewConTroller and so on. Just like in the Facebook app where you click a username and it moves to that user's timeline. And in that user's timeline you can click on another username etc.

So do I have to write code for 3 (4, 5, 6...) ViewControllers or is there a reliable way I can write code for 2 ViewControllers only?

4

1 回答 1

1

You just need to code two view controllers. From your first DetailViewController, you create and push a new DetailViewController. The one you pushed will have the exact same code, so you can push another DetailViewController.

If you have no top level view controller which is different from those DetailViewControllers, then you only need to code one type of view controller.

Note that this way of doing things needs to have your DetailViewControllers contained in a UINavigationController, which handles the pushing of new view controllers.

于 2013-03-30T14:13:23.213 回答