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

点赞之后,再评论崩溃了,必现的。 #2

Open
coffeemao opened this issue Jan 29, 2018 · 5 comments
Open

点赞之后,再评论崩溃了,必现的。 #2

coffeemao opened this issue Jan 29, 2018 · 5 comments

Comments

@coffeemao
Copy link

coffeemao commented Jan 29, 2018

点赞之后增加了一行,在评论崩溃了,必现

@coffeemao
Copy link
Author

coffeemao commented Jan 29, 2018

[momentItemViewModel.dataSource addObject:commentItemViewModel];
这个数组在点赞之后变成了不可变熟组了,导致崩溃,没跟踪到哪里改变的。

@CoderMikeHe
Copy link
Owner

好的,已经定位到了错误位置,MHMomentItemViewModel.m 第223行代码导致的,笔者会火速修复该Bug

@coffeemao
Copy link
Author

if (self.dataSource) {
[ops addObject:atti];
[ops addObjectsFromArray:self.dataSource];
self.dataSource = ops.mutableCopy;

            }else{
                self.dataSource = [NSMutableArray arrayWithArray:@[atti]];
            }

@CoderMikeHe
Copy link
Owner

嗯嗯 ,之前用的是不可变的,后面要做评论数据的时候,才改成不可变的。后面这里就忘记修正了。

@coffeemao
Copy link
Author

笔者这雷厉风行的劲,学习

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

2 participants