我正在使用自定义的UITableViewCell。这也是导致卡顿的原因吗?
我的自定义UITableViewCell如下图所示:
![enter image description here](https://istack.dev59.com/snYim.webp)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%d%d",indexPath.row,indexPath.section];
tableViewCellActiviteiten *cell = (tableViewCellActiviteiten *)[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"tableViewCellActiviteiten" owner:self options:nil];
cell = (tableViewCellActiviteiten *)[nib objectAtIndex:0];
}
cell.thetitle.text = [self.alletitels objectAtIndex:indexPath.row];
cell.thesubtitle.text = [self.allesubtitels objectAtIndex:indexPath.row];
NSString * imagePath = [self.alleimages objectAtIndex:indexPath.row];
NSURL * imageURL = [NSURL URLWithString:imagePath];
NSData * imageData = [NSData dataWithContentsOfURL:imageURL];
UIImage * image = [UIImage imageWithData:imageData];
cell.image.image = image;
return cell;
}
数组内容:
self.alletitels
包含一个字符串:"活动标题"
self.allesubtitels
包含一个字符串:"活动副标题"
self.alleimages
包含一个 URL: "http://m2.myhappygames.com//files/pics/0/Paranormal_Shark_Activity_3.jpg"
有人能指出导致滚动卡顿的原因吗?