ChieldViewControllers中的错误指令

时间:2016-05-24 04:48:28

标签: ios swift uistoryboard uicontainerview

使用PageMenuController时遇到问题,

在此System.Int32 source code in the .Net reference Source中,说明是将ContainerView添加到我的视图中并将我的控制器类嵌入到我的视图中

这是我的代码:

testViewController

let viewController = self.storyboard?.instantiateViewControllerWithIdentifier("TestTableViewController") as! TestTableViewController
viewController.title = "Menu title"

let viewController1 = self.storyboard?.instantiateViewControllerWithIdentifier("Test1TableViewController") as! Test1TableViewController
viewController1.title = "Menu title"

let viewControllers = [viewController, viewController1]

let pagingMenuController = self.childViewControllers.first as! PagingMenuController
pagingMenuController.delegate = self

options.menuHeight = 60
options.menuDisplayMode = .Standard(widthMode: .Flexible, centerItem: true, scrollingMode: .PagingEnabled)
options.menuItemMode = .None
pagingMenuController.setup(viewControllers, options: options)

但我在self.childViewControllers.first as! PagingMenuController收到错误,错误消息为EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

我认为错误不是来自PagingMenuController,请帮助我如何识别错误?

0 个答案:

没有答案