UISplitViewController 的主视图是否总是必须是 UITableView? [英] Does a UISplitViewController's master view always have to be a UITableView?

查看:21
本文介绍了UISplitViewController 的主视图是否总是必须是 UITableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前多次使用 UISplitViewController 没有问题(好吧,我已经解决了问题;-) 但是,我以前一直使用 UITableView 作为主视图,因为这是显而易见的选择.今天我需要一些不同的东西,所以我只是提供一个 UIView.

I've used UISplitViewController several times before without problems (well, problems that I've fixed anyway ;-) However, I have always previously used a UITableView as the master view, as that's the obvious choice. Today I have need for something a little different, so I'm just providing a UIView.

但是,我得到了例外,

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "MyViewController" nib but didn't get a UITableView.'

我在 Apple 文档中找不到提及主视图必须始终是 UITableView 的文档,只有对用于显示列表的主视图的引用.

I can't find mention in the Apple documentation that the master view must always be a UITableView in the documentation, there's just a reference to the master view being used to display a list.

是否有规定主视图必须始终是 UITableView?

Is there a rule that the master view must always be a UITableView?

推荐答案

不,没有.

我在更改 iPad 习惯用法的代码时犯了一个错误,但在 iPhone 上进行了测试 - 糟糕!

I'd made a mistake by changing the code for the iPad idiom, but testing on an iPhone - whoops!

这篇关于UISplitViewController 的主视图是否总是必须是 UITableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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