objective c - Clear NSTableView Content -
i have nstableview
gets filled data program. have reset button that, amongst uses other parts of program, should clear nstableview
's data.
however, have absolutely no idea how this. i'm still learning obj-c.
you can remove objects 1 one nstableview calling removerowsatindexes:
(documentation here) , calling reloaddata
on nstableview.
if want clear of data, you'll need clear datasource (usually nsarray provide table data) , call reloaddata
. clear datasource, if nsdictionary or nsarray, call removeallobjects
on nsdictionary or nsarray. here's example of might do:
[mydatasourcedictionary removeallobjects]; [mytableview reloaddata];
take @ apple's documentation on nstableview too.
Comments
Post a Comment