相关疑难解决方法(0)

由于突出显示问题,UICollectionView随机崩溃

我有一个UICollectionViewiOS7强烈滚动时随机崩溃的东西.我启用了僵尸,发现它给了我一个错误说:

*** -[NSIndexPath section]: message sent to deallocated instance 0x17dbc970
Run Code Online (Sandbox Code Playgroud)

我相信这是由于此处描述的Apple错误.显然,当有人在快速滚动时突出显示一个单元格时,应用程序会崩溃,然后当操作系统离开屏幕时,操作系统会在它不再存在时尝试取消它.建议的解决方案是禁用userInteractionEnabled单元格的属性,然后使用处理选择UIGestureRecogniser.

还有其他人遇到同样的问题吗?此外,我尝试取消设置userInteractionEnabled属性并使用手势识别器,但这似乎不起作用.知道如何解决这个问题吗?

编辑:代码根据要求添加

-(UICollectionViewCell*) collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{

NSString *CellIdentifier = @"Gallery_Cell";

GalleryCell *cell= (GalleryCell *)[self.flowCollection dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];

if (indexPath.row < self.collectionData.count) {

    CellDetails *dets = [self.collectionData objectAtIndex:indexPath.row];

    NSURL *mainImageURL = [NSURL URLWithString:dets.imageURL];

    cell.image.contentMode = UIViewContentModeScaleAspectFill;
    cell.image.clipsToBounds = YES;

    if ([[[SDWebImageManager sharedManager] imageCache] imageFromDiskCacheForKey:[self cacheKeyForURL:mainImageURL]] == nil) {

          [cell.image setImageWithURL:mainImageURL placeholderImage:nil];

    }else{

          [cell.image setImage:[[[SDWebImageManager sharedManager] imageCache] imageFromDiskCacheForKey:[self …
Run Code Online (Sandbox Code Playgroud)

objective-c uigesturerecognizer uicollectionview uicollectionviewcell ios7

4
推荐指数
1
解决办法
5193
查看次数