首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >PageViewController crash setViewControllers

PageViewController crash setViewControllers
EN

Stack Overflow用户
提问于 2015-03-13 10:00:46
回答 1查看 851关注 0票数 0

我有PageViewController,我想向viewControllerAtIndex展示我的代码:

代码语言:javascript
运行
复制
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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-13 12:52:21

它在Mac操作系统上更新后才能工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29029373

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档