Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios EXC_错误访问(SIGILL)在使用自动布局时崩溃?_Ios_Crash_Autolayout_Exc Bad Access - Fatal编程技术网

Ios EXC_错误访问(SIGILL)在使用自动布局时崩溃?

Ios EXC_错误访问(SIGILL)在使用自动布局时崩溃?,ios,crash,autolayout,exc-bad-access,Ios,Crash,Autolayout,Exc Bad Access,此崩溃仅发生在iOS 10.2.1上,其他设备或模拟器都可以。因为我没有iOS 10.2.1设备或模拟器,所以无法复制 这里是(Github链接) 我所做的是从服务器获取数据,然后通过UITableView重新加载数据。重新加载数据时崩溃。所有操作都在主队列块中 UITableViewCell中的一些代码如下: - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseI

此崩溃仅发生在iOS 10.2.1上,其他设备或模拟器都可以。因为我没有iOS 10.2.1设备或模拟器,所以无法复制

这里是(Github链接)

我所做的是从服务器获取数据,然后通过
UITableView
重新加载数据。重新加载数据时崩溃。所有操作都在主队列块中

UITableViewCell
中的一些代码如下:


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        [self.contentView addSubview:self.avatarImageView];
        [self.contentView addSubview:self.messageBackgroundView];
        [self.messageBackgroundView addSubview:self.messageTextView];
    }
    return self;
}

+ (BOOL)requiresConstraintBasedLayout {
    return YES;
}

- (void)prepareForReuse {
    [super prepareForReuse];

    [self.messageBackgroundView mas_remakeConstraints:^(MASConstraintMaker *make) {

    }];
}

- (void)updateConstraints {

    [self.avatarImageView mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.size.mas_equalTo(CGSizeMake(38, 38));
        make.top.equalTo(self.contentView.mas_top).offset(9).priorityHigh();
        if (self.myself) {
            make.trailing.equalTo(self.contentView.mas_trailing).offset(-18);
        } else {
            make.leading.equalTo(self.contentView.mas_leading).offset(18);
        }

    }];

    [self.messageBackgroundView mas_remakeConstraints:^(MASConstraintMaker *make) {

        if (self.myself) {
            make.trailing.equalTo(self.avatarImageView.mas_leading).offset(-9);
            make.leading.mas_greaterThanOrEqualTo(self.contentView.mas_leading).offset(44);
        } else {
            make.leading.equalTo(self.avatarImageView.mas_trailing).offset(9);
            make.trailing.mas_lessThanOrEqualTo(self.contentView.mas_trailing).offset(-44);
        }

        make.top.equalTo(self.avatarImageView.mas_top);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-9).priorityHigh();
    }];

    [self.messageTextView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.messageBackgroundView).insets(UIEdgeInsetsMake(8, 14, 8, 14));
        make.height.equalTo(@(self.textViewHeight));
    }];

    [super updateConstraints];
}

- (void)setMessage:(GWBaseModel *)message {

    _message = message;

    // ... update ui, set height for textview

    [self setNeedsUpdateConstraints];

}

请在此处添加崩溃日志,以便更好地理解问题。@Swati日志内容太长,无法将所有内容都放在此处。说明中的github链接可能会提供更好的预览效果。能否尝试在BeginUpdate和EndUpdate之间添加重载数据?@Swati谢谢,但它不起作用。测试人员告诉我,这种情况仍然存在。它只发生在iOS 10.2.1上,这让我很烦。iOS 10.2.1有什么特别之处吗?检查iOS发行说明后,我什么都没有。请在此处添加崩溃日志,以便更好地了解问题。@Swati日志内容太长,无法将所有内容都放在此处。说明中的github链接可能会提供更好的预览效果。能否尝试在BeginUpdate和EndUpdate之间添加重载数据?@Swati谢谢,但它不起作用。测试人员告诉我,这种情况仍然存在。它只发生在iOS 10.2.1上,这让我很烦。iOS 10.2.1有什么特别之处吗?在检查了iOS发行说明后,我什么也没有得到。