您的位置:首页 > 产品设计 > UI/UE

UITableView防止重用

2014-03-01 18:08 225 查看
防止重用方法一:

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    替换为:

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //根据indexPath准确地取出一行,而不是从cell重用队列中取出

     防止重用方法二:

     static NSString* cellIdentifier = @"cell";

     替换为:

     NSString *cellIdentifier = [NSString stringWithFormat:@"Cell%ld%ld", (long)[indexPath section], (long)[indexPath row]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  IOS