Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash在NSMutableArray+SafeKit.h 的-(void)SKaddObject:(id)anObject方法处 #6

Open
Ilikewhite opened this issue Nov 28, 2014 · 0 comments

Comments

@Ilikewhite
Copy link

UIImageView在重置Constraints时,会有很高的概率crash。
我们的代码如下:先清除了自己之前的约束,然后重新增加新的约束,然后-(void)SKaddObject:(id)anObject报错,导致crash

    //经验值条增长动画
    [self.expLineImageView removeConstraints:self.expLineImageView.constraints];
    [self.expLineImageView addConstraint:[NSLayoutConstraint
                                             constraintWithItem:self.expLineImageView
                                                      attribute:NSLayoutAttributeHeight
                                                      relatedBy:NSLayoutRelationEqual
                                                         toItem:nil
                                                      attribute:0
                                                     multiplier:1
                                                       constant:2]];
    [self.expLineImageView addConstraint:[NSLayoutConstraint
                                             constraintWithItem:self.expLineImageView
                                                      attribute:NSLayoutAttributeWidth
                                                      relatedBy:NSLayoutRelationEqual
                                                         toItem:nil
                                                      attribute:0
                                                     multiplier:1
                                                       constant:320 * _levelPercent]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant