UITableViewController and moving from an iPhone app to a Universal App

纵饮孤独 提交于 2019-12-12 02:57:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!