此代码曾用于我们今天的扩展,但现在EXC_BAD_ACCESS使用Xcode 6.3。什么是新问题?
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
coordinator.animateAlongsideTransition({ context in
self.tableView.frame = CGRectMake(0, 0, size.width, size.height)
}, completion: nil)
}
答案 0 :(得分:3)
有人向我提到他们认为这是一个Apple bug。这是一种解决方法(或解决方案):
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator)
{
super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
if let safeCoordinator = coordinator as UIViewControllerTransitionCoordinator?
{
println("coordinator != nil")
safeCoordinator.animateAlongsideTransition({ context in
self.tableView.frame = CGRectMake(0, 0, size.width, size.height)
}, completion: nil)
}
else
{
println("coordinator == nil")
}
}