UITableViewController并从iPhone应用程序迁移到通用应用程序 [英] UITableViewController and moving from an iPhone app to a Universal App

查看:66
本文介绍了UITableViewController并从iPhone应用程序迁移到通用应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将应用程序升级为通用应用程序,我最初是在xCode 3中制作该应用程序的,所以我根本不使用情节提要.

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.

我有一个导航控制器,可以在iPhone版本上推送两个类似的UITableView控制器:

I have a navigation controller that pushes two UITableView Controllers like this on the iPhone version:

iPhone:欢迎屏幕视图-> UITableViewController-> UITableViewController(详细信息)-> ViewController

iPhone: Welcome Screen View -> UITableViewController -> UITableViewController (detail) -> ViewController

使iPad就绪的最佳方法是什么?

What is the best way to make this iPad ready?

我了解我需要使用SplitViewController.如果设备是iPad,我是否应该从欢迎屏幕中推送iPad特定的SplitViewController:

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:欢迎屏幕视图-> SplitViewController->视图控制器

iPad: Welcome Screen View -> SplitViewController -> View Controller

但是如果它是iPhone应用程序,请使用UITableView控制器,还是应该以某种方式实现它,以便我为两个设备使用相同的类?

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?

推荐答案

您的流程看上去不错.拆分视图控制器实际上将保存UITableViewController和UITableViewController(详细信息),因此您不必实际编写任何新类.您只需要做一下,当您在UITableViewController中点击一行时,它不会告诉导航控制器按下详细信息表视图控制器,而只是对其进行更新.

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.

通常,UISplitViewController是根类,因此您不会将其放在UINavigationController中(我不确定是否可以这样做).看看是否可以将欢迎屏幕设置为模式视图控制器(甚至可以使用表单样式进行显示).至于View Controller,则取决于您使用该特定类的目的.

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.

这篇关于UITableViewController并从iPhone应用程序迁移到通用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆