RollingNotice
RollingNotice copied to clipboard
崩溃位置,如下图所示
在GYRollingNoticeView.m
的93行,int count = (int)[self.dataSource numberOfRowsForRollingNoticeView:self];
崩溃
原因呢,你是什么情况下崩溃的,设置dataSource 了吗
设置了
- (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;
}
额 MJHomeNoticeCell 这个继承了GYNoticeViewCell了吗
或者你方便建个空工程,把你的类发出来吗
继承了。因为我也没有复现这个崩溃,我是根据苹果提供的崩溃信息定位到的
这是崩溃信息截图,希望有帮助。
这看不出来啊 复现也复现不了。只能先观察了😢
会不会是后台久了,被系统干掉了
楼主,我好像是也遇到了这个问题。
又复现了,同样的位置,
could not execute support code to read Objective-C class data in the process. This may reduce the qu
好的 我查下你这个原因的资料。 你可以主动复现吗 @Baiyongyu
搜到一个资料说懒加载不能用self. ,看了下代码里面没有self. 有个self 改了下,可以在这里下新版试下,还没推到pod上,感觉不像这的问题
偶发性的,复现也挺难。
这个功能是在app首页,导致崩溃的原因应该都是进入到其他页面,然后返回首页的时候,不止什么原因就导致偶发性崩溃了
你有在首页 视图出现和视图消失的时候,操作这个控件吗
操不操作,都会导致这个崩溃,一开始没有调用stop的操作,我后在视图消失的时候加上的。
![image](https://user-images.githubusercontent.com/18496805/43764300-b76b463a-9a5f-11e8-98a9-02f98cf53241.png)
我昨天用模拟器挂了一天,包括停留首页,进入第二页,返回。 都没问题
如果不需要释放内存的,不用在页面消失时 停止
https://www.jianshu.com/p/4989c498e21e 可以看下这个,检查下内存,是不是DataSource被释放了🙏
改用weak
有道理,感谢@qhlonger提出,我写assign写习惯了,对象用weak好些,先更新git上的,pod 暂时没更新