Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to perform multiple selection in NSTableView

I am a beginner to objective c.Please tell me that how perform multiplay selection in NSTableView.I am unable to retain previous selection, when i am clicking on another row.

like image 536
Richa Vijayvargiya Avatar asked Sep 03 '10 11:09

Richa Vijayvargiya


3 Answers

You have to enable multiple selection on the table view by calling:

[tableView setAllowsMultipleSelection: YES]

You can then select multiple rows by pressing Command+Click on the rows you want.

like image 132
Thomas Avatar answered Oct 23 '22 04:10

Thomas


The method call you are looking for is

- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend 
like image 34
Lothar Avatar answered Oct 23 '22 03:10

Lothar


I hope you would have got the answer, but the better way is, when you click the check box, you could select the row by using api selectRowIndex and once you want to process, you could get all the selectedItemindexes,

like image 1
Amitg2k12 Avatar answered Oct 23 '22 03:10

Amitg2k12