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

崩溃位置,如下图所示 #5

Open
HKH01 opened this issue Mar 14, 2018 · 22 comments
Open

崩溃位置,如下图所示 #5

HKH01 opened this issue Mar 14, 2018 · 22 comments

Comments

@HKH01
Copy link

HKH01 commented Mar 14, 2018

GYRollingNoticeView.m的93行,int count = (int)[self.dataSource numberOfRowsForRollingNoticeView:self];崩溃

@maltsugar
Copy link
Owner

原因呢,你是什么情况下崩溃的,设置dataSource 了吗

@HKH01
Copy link
Author

HKH01 commented Mar 14, 2018

设置了

- (GYRollingNoticeView *)noticeView {
    if (!_noticeView) {
        _noticeView = [[GYRollingNoticeView alloc] init];
        _noticeView.backgroundColor = [UIColor whiteColor];
        _noticeView.dataSource = self;
        _noticeView.delegate = self;
        [_noticeView registerClass:[MJHomeNoticeCell class] forCellReuseIdentifier:NSStringFromClass([MJHomeNoticeCell class])];
    }
    return _noticeView;
}
- (NSInteger)numberOfRowsForRollingNoticeView:(GYRollingNoticeView *)rollingView {
    
    return self.noticeArray.count;
}

- (__kindof GYNoticeViewCell *)rollingNoticeView:(GYRollingNoticeView *)rollingView cellAtIndex:(NSUInteger)index {
    
    MJHomeNoticeCell *noticeCell = [rollingView dequeueReusableCellWithIdentifier:NSStringFromClass([MJHomeNoticeCell class])];
    if (!noticeCell) {
        noticeCell = [[MJHomeNoticeCell alloc] initWithReuseIdentifier:NSStringFromClass([MJHomeNoticeCell class])];
    }
    if (self.noticeArray.count) {
        noticeCell.titleStr = self.noticeArray[index];
    }
    
    return noticeCell;
}

@maltsugar
Copy link
Owner

额 MJHomeNoticeCell 这个继承了GYNoticeViewCell了吗

@maltsugar
Copy link
Owner

或者你方便建个空工程,把你的类发出来吗

@HKH01
Copy link
Author

HKH01 commented Mar 16, 2018

继承了。因为我也没有复现这个崩溃,我是根据苹果提供的崩溃信息定位到的

@HKH01
Copy link
Author

HKH01 commented Mar 16, 2018

default
这是崩溃信息截图,希望有帮助。

@maltsugar
Copy link
Owner

这看不出来啊 复现也复现不了。只能先观察了😢

@maltsugar
Copy link
Owner

会不会是后台久了,被系统干掉了

@Baiyongyu
Copy link

楼主,我好像是也遇到了这个问题。

@Baiyongyu
Copy link

又复现了,同样的位置,
could not execute support code to read Objective-C class data in the process. This may reduce the qu

@maltsugar
Copy link
Owner

好的 我查下你这个原因的资料。 你可以主动复现吗 @Baiyongyu

@maltsugar
Copy link
Owner

搜到一个资料说懒加载不能用self. ,看了下代码里面没有self. 有个self 改了下,可以在这里下新版试下,还没推到pod上,感觉不像这的问题

@Baiyongyu
Copy link

偶发性的,复现也挺难。

@Baiyongyu
Copy link

这个功能是在app首页,导致崩溃的原因应该都是进入到其他页面,然后返回首页的时候,不止什么原因就导致偶发性崩溃了

@maltsugar
Copy link
Owner

你有在首页 视图出现和视图消失的时候,操作这个控件吗

@Baiyongyu
Copy link

操不操作,都会导致这个崩溃,一开始没有调用stop的操作,我后在视图消失的时候加上的。

@Baiyongyu
Copy link

image

@maltsugar
Copy link
Owner

我昨天用模拟器挂了一天,包括停留首页,进入第二页,返回。 都没问题

@maltsugar
Copy link
Owner

如果不需要释放内存的,不用在页面消失时 停止

@maltsugar
Copy link
Owner

https://www.jianshu.com/p/4989c498e21e
可以看下这个,检查下内存,是不是DataSource被释放了🙏

@qhlonger
Copy link

image
改用weak

@maltsugar
Copy link
Owner

有道理,感谢@qhlonger提出,我写assign写习惯了,对象用weak好些,先更新git上的,pod 暂时没更新

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

4 participants