做了个多选的功能。问题:当数据超过当前视图范围后,往下移动view, 上面已经选择了的cell会被刷新成没被选择之前的样式,不过那条纪录已经被添加到我定义的数组里面了,只是cell视图被还原了。

解决方案 »

  1.   

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 在这个函数里面判断当前要显示的纪录是否在你定义的数组里面,设置cell的选中视图。在- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 这里设置选中数组,设置cell的选中视图
      

  2.   


    可是我下拉table的时候,并没有刷新tableview啊,
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 这个方法不会被执行吧。。?