我在我的项目中面临一个小问题。我有一个简单的 iPad 应用程序,它在横向方向使用 SplitView。MasterViewController 是 tableview 而 DetailView 是 WebView 如下所示:
上图结果如下:
在那之后,我把整个东西都放在了 ECSlidingViewController 里面。点击 MasterViewController 中的“菜单”按钮将显示侧边菜单,如下所示:
现在我可以点击菜单中的其他选项,假设我在菜单中点击了“联系人”,相关的视图控制器将如下所示:(此视图控制器没有任何详细视图)
到目前为止一切都很好,正是我想要的!!!!当我再次点击菜单按钮以显示菜单并再次选择“导航”以显示表格视图时,问题就开始了。当点击“导航”时,它会显示 MasterView 但隐藏 DetailView,如下所示:
除此之外,点击上面 tableivew 中的任何条目都会导致程序崩溃,并在控制台中显示以下消息:
* -[UIStoryboardReplaceSegue perform]、/SourceCache/UIKit_Sim/UIKit-2380.17/UIStoryboardBuiltInSegues.m:63 2013-03-30 13:59:58.179 19IPadIPad[5806:c07] 中的断言失败 *由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:'找不到''的拆分视图控制器祖先,同时执行拆分视图控制器将 segue(标识符'pushLink')替换为目标''' ***第一次抛出调用堆栈:(0x217b012 0x16bce7e 0x217ae78 0x1152665 0xa57349 0xa48b99 0xa48c14 0x6b0249 0x6b04ed 0x10ba5b3 0x213a376 0x2139e06 0x2121a82 0x2120f44 0x2120e1b 0x1d587e3 0x1d58668 0x600ffc 0x24bd dylib23e 调用)抛出异常c++5。
Can somebody look into the problem and tell where the problem could be. Thanks in advance.
UPDATE:
After talking to the user on chat who suggested that after i tap the navigation in menu, the next thing that appears is only the masterview and splitview is actually not loaded. Looks like that is the problem but i don't know how to fix that.
UPDATE:
How ECSlidingView Is Integrated With The SplitView
I am updating the question after receiving a comment asking how the ECSlidingView is connected to the project and the SplitView.
I have created a class named 'MainSplitViewController' inherited from UISplitViewController, and connected it with the splitView in my storyboard in the identity inspector. Also i have given it the Storyboard ID of "SplitTop".
Then in my InitialViewController i have called the SplitView as the topviewcontroller as follow:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
self.topViewController = [storyboard instantiateViewControllerWithIdentifier:@"SplitTop"];
}
The ECSlidingView menu appears when the "Menu" button is pressed on the MasterViewController as you can see in the images above. That menu button is using an IBAction to reveal the ECSlidingView:
- (IBAction)revealMenu:(id)sender {
[self.slidingViewController anchorTopViewTo:ECRight];
}