开发者

iOS UITableView scroll not smooth

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 anyb开发者_StackOverflow中文版ody 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.


for download images asynchronously use

http://www.markj.net/iphone-asynchronous-table-image/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜