如何在不使用-reloadData的情况下更新NSTableView? [英] How to update NSTableView without using -reloadData?

查看:266
本文介绍了如何在不使用-reloadData的情况下更新NSTableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mac的新手.我正在尝试不使用-reloadData来更新NSTableView中的特定单元格,因为-reloadData会更新整个表.我已经尝试了一切,但都徒劳无功.我正在尝试做与我们过去在MFC或.NET中的CListCtrl中所做的类似的事情.

I am new to the Mac. I am trying to update a particular cell in NSTableView without using -reloadData, as -reloadData updates the whole table. I have tried everything but all was in vain. I am trying to do something similar to what we used to do in CListCtrl in MFC or in .NET.

推荐答案

看看reloadDataForRowIndexes:columnIndexes:方法.要更新单个单元格,应执行以下操作:

Have a look at reloadDataForRowIndexes:columnIndexes: method. To update a single cell the following should work:

[yourTable reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:row]  
                     columnIndexes:[NSIndexSet indexSetWithIndex:column]];

这篇关于如何在不使用-reloadData的情况下更新NSTableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆