PageViewController 崩溃 setViewControllers
PageViewController crash setViewControllers
我有 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 on 8.3 on beta 2 上。
Link 至 Apple 开发论坛:https://devforums.apple.com/thread/264976
更新 Mac X OS
后有效
我有 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 on 8.3 on beta 2 上。
Link 至 Apple 开发论坛:https://devforums.apple.com/thread/264976
更新 Mac X OS
后有效