在TableView单元格中重新加载字符串

时间:2011-02-18 06:29:48

标签: iphone uitableview nsurlconnection nsdata

好的继承人。我有一个体育应用程序,我想更新分数(从网站解析)当viewdid出现或用户滚动列表时在tableview中。所以基本上更新单元格中存在的标签的文本,而不是仅仅将我的函数放在cellForRowAtIndex中,使得性能变得糟糕。

我尝试过使用NSURLConnection在tableview中异步加载图像,但没有任何运气(只有一个加载到表中)。我想知道是否有人之前做过这件事并且可以帮助我。

1 个答案:

答案 0 :(得分:1)

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;

Apple iOS reference library is here

            NSArray *indexPaths = [[NSArray alloc] initWithObjects:[NSIndexPath indexPathForRow:row inSection:section], nil];
            [(UITableView *)self.view reloadRowsAtIndexPaths: indexPaths
                                            withRowAnimation: UITableViewRowAnimationTop];

            [indexPaths release];
相关问题