问题
I'm working on upgrading my app to a Universal App, I made the app originally in xCode 3 so I'm not using storyboarding at all.
I have a navigation controller that pushes two UITableView Controllers like this on the iPhone version:
iPhone: Welcome Screen View -> UITableViewController -> UITableViewController (detail) -> ViewController
What is the best way to make this iPad ready?
I understand I need to use a SplitViewController. Do I push an iPad specific SplitViewController from the welcome screen if the device is an iPad:
iPad: Welcome Screen View -> SplitViewController -> View Controller
but use the UITableView controller if it is an iPhone app, or should I somehow implement it so that I am using the same class for both devices?
回答1:
Your flow looks about right. The split view controller would actually hold UITableViewController and UITableViewController (detail), so you don't have to actually write any new classes. You just have to make it so when you tap on a row in UITableViewController, it doesn't tell the navigation controller to push the detail table view controller, rather it simply updates it.
Generally, UISplitViewController is the root class, so you wouldn't put it in UINavigationController (which I'm not sure if it's possible to do that anyway). See if you can make your welcome screen a modal view controller (maybe even presenting using the form sheet style). As for View Controller, it depends on what you're using that specific class for.
来源:https://stackoverflow.com/questions/9609625/uitableviewcontroller-and-moving-from-an-iphone-app-to-a-universal-app