Explorar o código

Use strongDelegate to fix error: weak property may be unpredictably set to nil

Myles Abbott %!s(int64=11) %!d(string=hai) anos
pai
achega
e77fc99138
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Masonry/MASCompositeConstraint.m

+ 2 - 1
Masonry/MASCompositeConstraint.m

@@ -39,7 +39,8 @@
 }
 
 - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
-    MASConstraint *newConstraint = [self.delegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
+    id<MASConstraintDelegate> strongDelegate = self.delegate;
+    MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
     newConstraint.delegate = self;
     [self.childConstraints addObject:newConstraint];
     return newConstraint;