Rightpoint / Anchorage

A collection of operators and utilities that simplify iOS layout code.
MIT License
627 stars 46 forks source link

EXC_BAD_ACCESS switching from 4.0.0 to 4.1.0+ #64

Open thomasneuteboom opened 5 years ago

thomasneuteboom commented 5 years ago

I get a bad access exception by switching the version from 4.0.0 to 4.1.0 (or higher):

Internal.swift line 155: switch (first, anchors.first, second, anchors.second) {

Full error: Thread 1: EXC_BAD_ACCESS (code=1, address=0x600100000000)

By calling horizontalAnchors in a custom UIView.

//...
private let containerView: UIView

override init(frame: CGRect) {

    //...
    super.init(frame: frame)

    self.addSubview(self.containerView)

    self.containerView.horizontalAnchors == self.horizontalAnchors // Runtime error here.
}
//...

I've tried searching for any associated zombie objects, but couldn't find any.

Everything is working fine prior to version 4.1.

Did something significant change between the versions that I am not aware of? Or am I looking over something trivial?

ZevEisenberg commented 5 years ago

Which version of Swift are you using?

thomasneuteboom commented 5 years ago

Hi @ZevEisenberg, thanks for responding! We are using Swift 3.2.

iBolom commented 5 years ago

@ZevEisenberg Same problem with Swift 4.2, Xcode 10.1.

ZevEisenberg commented 5 years ago

Can anyone who is still seeing this (👋 @iBolom) please post a sample project that reproduces this issue?