在TableView Cell中重新加载字符串

问题描述:

好吧继承人的交易。我有一个运动应用程序,我想在viewdidappear或当用户滚动列表时更新桌面视图中的分数(从网站解析)。所以基本上更新一个单元格中的标签文本,而不是只把我的函数放在cellForRowAtIndex中,使得性能变得糟糕。在TableView Cell中重新加载字符串

我试图做类似加载图像异步使用NSURLConnection的一个实现代码如下,但没有任何运气(只有一个被加载到表)。我想知道如果有人以前做过,并可以帮助我。

+1

你想要做的。显示文本或图像什么exaclty? – Swastik 2011-02-18 06:35:44

+0

文本。我在单元格上有一个标签,我想用我已解析的网页中的数据更新 – Pete42 2011-02-18 07:16:49

- (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];