0

这里真正的基本问题:

我想构建一个应用程序,它有一堆可以从 TabView 访问的 MasterDetail 视图。

我想从 MasterDetail 项目模板开始,但如果我这样做并将 TabController 扔到情节提要的前面,我会崩溃。

2012-04-08 12:51:21.205 SMToolkit[22630:fb03] -[UISplitViewController topViewController]:   unrecognized selector sent to instance 0x82491c0
2012-04-08 12:51:21.208 SMToolkit[22630:fb03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISplitViewController topViewController]: unrecognized selector sent to instance 0x82491c0'
*** First throw call stack:
(0x16ad022 0x183ecd6 0x16aecbd 0x1613ed0 0x1613cb2 0x2bf9 0x16386 0x17274 0x26183 0x26c38 0x1a634 0x1597ef5 0x1681195 0x15e5ff2 0x15e48da 0x15e3d84 0x15e3c9b 0x16c65 0x18626 0x2a6d 0x29d5)
terminate called throwing an exception(lldb) 

到目前为止我所做的只是在情节提要中(实际上我做了一个新的 MasterDetail 项目,然后进入情节提要并在其前面放置了一个 tabcontroller)

4

1 回答 1

2

简单的答案是 Master Detail 中为您提供的模板包含一些您可能不想要的代码。

在 AppDelegate.m 中查找以下方法并简单地拥有它return YES;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    return YES;
}
于 2012-04-23T23:29:32.127 回答