2012-04-08 51 views
0

真的基本問題在這裏:TabController內的iOS MasterDetail應用程序 - 從哪裏開始?

我想建立一個應用程序,有一大堆的MasterDetail視圖,可以從TabView訪問。

我想從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在它前面)

回答

2

簡單的答案是,在Master Detail中爲您提供的模板包含您可能不想要的一些代碼。

在AppDelegate.m查找下面的方法,只是把它return YES;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    // Override point for customization after application launch. 
    return YES; 
}