我有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'
viewControllers不为空我有<My_App.MyPages: 0x7fcce9813e00>
这种情况发生在测试版2的新版beta 3上。
Apple Dev论坛链接:https://devforums.apple.com/thread/264976
答案 0 :(得分:0)
在Mac X OS上更新后可以正常使用