修复了一些可能数组越界的问题
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "NSArray+Safe.h"
|
||||
///View
|
||||
#import "XPMineDataSkillDataCollectionViewCell.h"
|
||||
|
||||
@@ -78,14 +79,14 @@
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPMineDataSkillDataCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDataSkillDataCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.skillInfo = [self.datasourece objectAtIndex:indexPath.row];
|
||||
cell.skillInfo = [self.datasourece safeObjectAtIndex1:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasourece.count > 0) {
|
||||
MineSkillCardListInfoModel * skillInfo = [self.datasourece objectAtIndex:indexPath.row];
|
||||
MineSkillCardListInfoModel * skillInfo = [self.datasourece safeObjectAtIndex1:indexPath.row];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataSkillCardTableViewCell:didSelectItem:)]) {
|
||||
[self.delegate xPMineDataSkillCardTableViewCell:self didSelectItem:skillInfo];
|
||||
}
|
||||
|
Reference in New Issue
Block a user