Skip to content

iOS 8.3 crashes when installing constraints on views that are not in the view hierarchy #185

Description

@philipengberg

It crashes with the following exception:

+[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: 
A multiplier of 0 or a nil second item together with a location for the first attribute creates 
an illegal constraint of a location equal to a constant. Location attributes must be specified in 
pairs.

This is the stack trace:

3  Foundation    0x0000000184a05ecc VerifyConstraintArguments + 220
4  Foundation    0x000000018488dad0 +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:] + 440
5  App           0x000000010049c348 -[MASViewConstraint install] (MASViewConstraint.m:291)
6  App           0x0000000100499fdc -[MASConstraintMaker install] (MASConstraintMaker.m:45)
7  App           0x000000010049e0e8 -[UIView(MASAdditions) mas_updateConstraints:] (View+MASAdditions.m:26)

As the title says, this only happens for views that have not been added to the view hierarchy.

Masonry version (0.6.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions