My app contains some UITableViews, and cells contain several views. The cells also need to load images from server, so I use the open source tool named SDWenImage to asynchronously load images.
The problem is that UITableViews scroll smoothly in simulator, but not smoothly in iOS devices. Can anybody tell me why and how to solve the problem.
Following is some code related to the above problem:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CellIdentifier";
ItemTableViewCell *cell = (ItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = (ItemTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"ItemTableViewCell" owner:self options:nil] lastObject];
}
GroupBuy *groupBuy = [tableArray objectAtIndex:indexPath.row];
cell.groupBuy = groupBuy;
[cell refreshData];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[[NSNotificationCenter defaultCenter] addObserver:cell selector:@selector(starAction:) name:@"StarAction" object:nil];
return cell;
}
Thank you very much.