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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -