Post

Replies

Boosts

Views

Activity

Reply to Crash in iOS18
I also encountered the crash problem. This is the original code: (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { HomeCellUnconnected *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellClassNameUnconnected forIndexPath:indexPath]; if (self.datas.count > indexPath.row) { NSString *cellClassName = self.datas[indexPath.row]; cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellClassName forIndexPath:indexPath]; } return cell; } this is the modified code: (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { NSString *cellClassName = self.datas[indexPath.row]; UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellClassName forIndexPath:indexPath]; return cell; }
Nov ’24