UIPageViewController崩溃setViewControllers

时间:2015-03-13 10:00:47

标签: swift uipageviewcontroller

我有PageViewController,我想在这里显示viewControllerAtIndex是我的代码:

let startingViewController: MyPages = self.viewControllerAtIndex(0, storyboard: self.storyboard!)!
let viewControllers: NSArray = [startingViewController]
pageViewController.setViewControllers(viewControllers as [AnyObject], direction: .Forward, animated: false, completion: nil)

但是我的应用程序崩溃了Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'

printcn上的

viewControllers不为空我有<My_App.MyPages: 0x7fcce9813e00> 这种情况发生在测试版2的新版beta 3上。

Apple Dev论坛链接:https://devforums.apple.com/thread/264976

1 个答案:

答案 0 :(得分:0)

在Mac X OS上更新后可以正常使用