我有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在println上不是空的,我有<My_App.MyPages: 0x7fcce9813e00>
,这发生在新的beta 3中,在8.3上,在beta 2上,它可以工作。
链接到Apple论坛:https://devforums.apple.com/thread/264976
发布于 2015-03-13 12:52:21
它在Mac操作系统上更新后才能工作。
https://stackoverflow.com/questions/29029373
复制相似问题