EXC_BAD_ACCESS与viewWillTransitionToSize和Xcode 7

时间:2015-09-21 11:02:41

标签: ios xcode exc-bad-access swift2 xcode7

我在Xcode 7中获得了一个带有viewWillTransitionToSize的EXC_BAD_ACCESS。这里发布的解决方案EXC_BAD_ACCESS with viewWillTransitionToSize and Xcode 6.3起作用,直到我升级到XCode 7。

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator:   UIViewControllerTransitionCoordinator)
{
    super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)

    if let safeCoordinator = coordinator as UIViewControllerTransitionCoordinator?
    {
        // Error: EXC_BAD_ACCESS here
        print("coordinator != nil")
        safeCoordinator.animateAlongsideTransition({ context in
            self.tableView.frame = CGRectMake(0, 0, size.width, size.height)
        }, completion: nil)

    } else {
        print("coordinator == nil")
    }
}

任何帮助都会得到满足。

0 个答案:

没有答案